2八月/10關閉
MySQL變更存放目錄
1. 停止MySQL service
2. cp -pr /var/lib/mysql /home/mysqldata
3. mv /var/lib/mysql /var/lib/mysql_bak
4. ln -s /home/mysqldata /var/lib/mysql
5. cd /tmp; unlink mysql.sock; ln -s /home/mysqldata/mysql.sock /tmp/mysql.sock
6. vi /etc/my.cnf
datadir=/home/mysqldata
socket=/home/mysqldata/mysql.sock
basedir=/home
7. 啟動MySQL service
8. 如有必要, 更改phpMyAdmin config
vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
Add
$cfg['Servers'][$i]['socket'] = ‘/home/mysql/mysql.sock’;
$cfg['Servers'][$i]['connect_type'] = ’socket’;