mysql实现linux下数据库目录迁移
1、查看mysql安装目录
从目录etc/my.cnf中查看安装目录
2、进入mysql目录,停止mysql服务cd usr/local/mysqlservice mysql stop(相关文章教程推荐:mysql视频教程)
3、移动整个mysql目录cp -rf /usr/local/mysql/home/mysql4、修改my.cnf文件中mysql位置,并保存 [client] default-character-set=utf8 [mysqld] character-set-server=utf8 datadir=/home/mysql/data basedir=/home/mysql socket=/home/mysql/tmp/mysql.sock lower_case_table_names=1 [mysqld_safe] log-error=/home/mysql/log/mysqld.log5、重启服务:cd usr/local/mysqlservice mysql start 遇到如下问题:
Starting MySQL.The server quit without updating PID file (/home/local/mysql/data/localhost.localdomain.pid).
解决方法如下:
修改/home/local/mysql/data目录权限,命令如下:chown -R mysql.mysql /home/local/mysql/data相关文章教程推荐:mysql教程以上就是mysql实现linux下数据库目录迁移的详细内容,更多请关注小潘博客其它相关文章!