centos change mysql default directory
see SELinux state : If not closed , To close
1,/usr/sbin/sestatus -v ## If SELinux status Parameters are enabled Is the open state
SELinux status: enabled
2,getenforce ## You can also check with this command
close SELinux
Machine restart required to modify configuration file :
modify /etc/selinux/config file
take SELINUX=enforcing Change to SELINUX=disabled
Just restart the machine

Must close first SELINUX, Refer to above

1, stay home Create under the directory data catalog
mkdir -p /home/data
2, stop it mysql service
service mysqld stop
3, hold /var/lib/mysql Move entire catalog to /home/data
mv /var/lib/mysql /home/data
4, set up /home/data/ lower mysql Owner and permission of folder
chown -R mysql:mysql /home/data/mysql
5, Modify profile /etc/my.cnf
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
datadir=/home/data/mysql
socket=/home/data/mysql/mysql.sock
# Support Chinese
character-set-server=utf8

6, Restart service service mysqld start

7, Check whether the directory is changed successfully
SHOW VARIABLES LIKE ‘datadir%’;
8, by mysql.sock Add soft connection ( No more , Can't get through localhost Sign in , Only through ip Sign in )
ln -s /home/data/mysql/mysql.sock /var/lib/mysql/mysql.sock
Due to the third step , No more /var/lib/mysql catalog , Must be recreated /var/lib/mysql catalog , The above command is valid
9, restart myssql service service mysqld restart
10, see mysql state service mysqld status

Technology
©2019-2020 Toolsou All rights reserved,
It's unexpected Python Cherry tree (turtle The gorgeous style of Library )Unity3D of UGUI Basics -- Three modes of canvas os Simple use of module computer network --- Basic concepts of computer network ( agreement , system )html Writing about cherry trees , Writing about cherry trees Some East 14 Pay change 16 salary , Sincerity or routine ?Unity-Demo Examples ✨ realization UI- Backpack equipment drag function 06【 Interpretation according to the frame 】 Data range filtering -- awesome java Four functional interfaces ( a key , simple )