rsync mysql 损坏_mysql常见问题

There are two main reasons for this error message to show:

1) The MySQL query you are trying to execute takes too long and the MySQL server times out.

The solution for this issue is to optimize your database for the queries which fail.

2) You have a crashed table in your database.

The solution in this case is to repair and optimize your database.

If a particular table crashes often and repairing/optimizing it does not help,  this most probably means that the table's structure is not working properly with our MySQL server setup. In such cases the easiest way to fix a crashed MyISAM table for good is to change its database engine from MyISAM to InnoDB

6:mysqldump中--default-character-set参数理解:

7:太多的sleep进程

mysql -uroot -p***后登陆数据库,show proceelist;发现有太多的sleep进程,见附件!

原因:my.cnf中的wait_timeout和interactive_timeout 设置的太大!

my.cnf中的相关设置如下:

wait_timeout            = 64800

interactive_timeout     = 64800

将其修改为:

wait_timeout            = 100

interactive_timeout     = 100

问题即可正常!

8:有一段时间测试两个数据库间同步,#我们的环境比较特殊不适合用mysql master/slave,有几天测试使用rsync同步数据库下的表,发现使用rsync同步后,表经常损坏!

首先要修复表,修复的方法:

mysqlcheck  -uroot –p***  --repair --extended  mydb

9:有时候为了确保数据一致性,需要刷新mysql 缓存

方法见附件:

10:有时候也可以优化数据库:

mysqlcheck -u root -p**** --auto-repair --optimize --all-databases ##自动修复优化所有数据库

11:修改使得root远程登陆

:默认情况下,不允许root远程登陆,进行下面修改后就可以使得root远程登陆

12: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

解决方法:

该错误表示 getcwd 命令无法定位到当前工作目录。一般来说是因为你 cd 到了某个目录之后 rm 了这个目录,这时去执行某些 service 脚本的时候就会报 getcwd 错误。只需要 cd 到任何一个实际存在的目录下在执行命令即可。

13:配置master/slave时遇到两个问题

13.1:

在slave上执行show master status;居然有显示,

原因:我在slave上也开启了log-bin文件!

解决方法:将该行注释掉,然后show master status就不会有结果显示了!

13.2:在配置master/slave时,

使用了grant all on test.* to ‘slaveuser’@’%’ identified by ‘slaveuser’;  ##应该使用grant all on *.* to ‘slaveuser’@’%’ identified by ‘slaveuser’; 当然all的权限太大了,可以适当的调小!

导致了就算slaveuser的密码正确也会提示密码错误!

14:为了安装mysql5.5.X 编译cmake,结果出错,见附件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值