-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql_setup.sh
More file actions
executable file
·50 lines (40 loc) · 1008 Bytes
/
sql_setup.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Script to install mysql on linux
# By: Shoaib wani
# version: 0.01
# different colos
function prRed() {
echo -ne "\033[91m"$1"\033[00m"
}
function prGreen() {
echo -ne "\033[92m"$1"\033[00m"
}
function prYellow() {
echo -ne "\033[93m"$1"\033[00m"
}
function prBlue() {
echo -ne "\033[94m"$1"\033[00m"
}
prGreen '[+] Installing Mariadb-Client & Mariadb-Server\n'
# installing mariadb client&server
sudo apt install mariadb-client mariadb-server > /dev/null 2>&1
if [[ $? -eq 0 ]]
then
prGreen '[+] Installation Complete\n'
prBlue '[+] Starting mysql\n'
systemctl tart mysql > /dev/null 2>&1
if [[ $? -eq 0 ]]
then
prGreen '[+] Started ...\n'
prYellow '[-] Enjoy!\n'
else
prRed '[x] Error while starting Mysql\n'
prYellow '[help] Try running : systemctl start mysql\n'
fi
else
prRed '[x] Couldnt Install mariadb\n'
prYellow '* Try running : '
prBlue 'sudo apt install mariadb-client mariadb-server\n'
prYellow '* then run : '
prBlue 'systemctl start mysql\n'
fi