欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mysql异机恢复时需要注意的地方

程序员文章站 2022-03-23 19:45:32
mysql 启动命令: /monitor/mysql/bin/mysqld --datadir=/home/tmp/ --user=mysql --log-error=/home...

mysql 启动命令:

/monitor/mysql/bin/mysqld --datadir=/home/tmp/ --user=mysql --log-error=/home/tmp/service2.err --pid-file=/home/tmp/service2.pid --socket=/home/tmp/mysql.sock --port=3308

如果当前环境已经有mysql 库运行:

1.需注意 datadir,pid-file,socket,log-error,port 等参数,不要和现有库环境冲突;

2.在使用 innobackupx 备份恢复后的文件,需要注意文件,文件目录的权限,属组是否正确?

可能的类似error:

[ERROR] InnoDB: Could not find a valid tablespace file for 'tpcc/order_line'. See https://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.

[ERROR] InnoDB: Tablespace open failed for '"tpcc"."order_line"', ignored.

InnoDB: Operating system error number 13 in a file operation.

InnoDB: The error means mysqld does not have the access rights toInnoDB: the directory.

处理方法:

chmod -R 777 *

chown -R mysql:mysql *