1.创建文件夹 /var/db
2.复制旧的mysql的数据库的文件到新的文件夹下
cp -rp /usr/local/mysql/data /var/db
3.修改mysql配置文件mysqld:
basedir=/usr/local/mysql
datadir=/var/db
pid_file=/var/db/mysqld.pid
4.修改mysql配置文件my.cnf
[client]
socket =/var/db/mysql.sock
[mysqld]
socket =/var/db/mysql.sock
5.关闭mysql
killall -9 mysqld_safe
killall -9 mysqld
6.启动mysql
/etc/init.d/mysqld start
7.验证修改结果:
ps ax |grep mysql
2.复制旧的mysql的数据库的文件到新的文件夹下
cp -rp /usr/local/mysql/data /var/db
3.修改mysql配置文件mysqld:
basedir=/usr/local/mysql
datadir=/var/db
pid_file=/var/db/mysqld.pid
4.修改mysql配置文件my.cnf
[client]
socket =/var/db/mysql.sock
[mysqld]
socket =/var/db/mysql.sock
5.关闭mysql
killall -9 mysqld_safe
killall -9 mysqld
6.启动mysql
/etc/init.d/mysqld start
7.验证修改结果:
ps ax |grep mysql