-
Notifications
You must be signed in to change notification settings - Fork 10
/
install-mariadb-cc7
48 lines (43 loc) · 1.37 KB
/
install-mariadb-cc7
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
#installation and initial configuration of mariadb client and server
#on rhel7/cc7
3 yum install mariadb mariadb-client
4 yum groups install mariadb mariadb-client
5 vi /etc/my.cnf
6 ip a s
7 vi /etc/my.cnf
8 echo bind-address=172.31.25.42
9 systemctl enable mariadb
10 systemctl start mariadb.service
11 mysql_secure_installation
12 systemctl restart mariadb.service
13 mysql -u root -p
14 systemctl disable iptables
15 yum install firewalld
16 systemctl enable firewalld
17 systemctl start firewalld
18 firewall-cmd --permanent --add-service=mysql
19 systemctl restart firewalld
20 firewall-cmd --permanent --add-service=mysql
22 firewall-cmd --reload
23 ss -tulpn |grep mysql
edit /etc/my.cnf and add this line to enable only local socket.
skip-networking=1
and then restart the service
pratice
create and show databases
create and describe tables
populate tables
update delete tables data
select quereis
join
grant
where clause
order by
functions avg , count , sum
subqueiers
backup and restore using mysqldump
mysqldump -u root -p database_name(s) > backupname.sql
mysqldump -u root -p --all-databases > alldb.sql
#restore
mysql -u root -p dbname < backup.sql
the dbname must already exist in case of single database name