错误1:在执行MysqL时 提示如下错误:
ERROR 1580 (HY000) at line 1: You cannot 'DROP' a log table if logging is enabled”
解决方法:执行set global slow_query_log=off,然后再次运行MysqL
错误2:在执行innobackupex时报如下错误:
innobackupex: Error: Failed to connect to MysqL server: DBI connect(';MysqL_read_default_file=/mvnobss/users/mysusr01/MysqL/bin/my.cnf;MysqL_read_default_group=xtrabackup;port=39301;
MysqL_socket=/mvnobss/users/mysusr01/MysqL/mydata/MysqLd-hdh-vocrmdb1-39301.sock','root',...) Failed: Can't connect to local MysqL server through socket '/mvnobss/users/mysusr01/MysqL/mydata/MysqLd-hdh-vocrmdb1-39301.sock'
解决方法:执行innobackupex备份的用户需要对MysqL数据目录有读取权限,并且对socket文件有读写权限
错误3:java应用报连接异常,错误信息如下:
cause: com.binary.jdbc.exception.DataSourceException: Cannot create PoolableConnectionFactory (null, message from server: "Host '10.123.121.252' is blocked because of many connection errors; unblock with 'MysqLadmin flush-hosts'")
解决方法:MysqLadmin -uroot -p flush-hosts
错误4:执行MysqLdump报如下错误:
MysqLdump: Error 2013: Lost connection to MysqL server during query when dumping table `res_card_storage_detail` at row: 510319
解决方法:将参数net_write_timeout的值加大(网上搜索的解决方法)
修改后问题依旧,通过观察系统日志发现有如下重要信息:
Jul 6 17:29:25 yt-votst1 kernel: Out of memory: Kill process 16398 (MysqLd) score 44 or sacrifice child
Jul 6 17:29:25 yt-votst1 kernel: Killed process 16398, UID 312, (MysqLd) total-vm:5289288kB, anon-RSS:1352100kB, file-RSS:768kB
接着查看系统内存设置:
free -m
total used free shared buffers cached
Mem: 29970 29830 139 0 169 224
-/+ buffers/cache: 29436 533
Swap: 0 0 0
结论:所以这里MysqLdump报错的真正原因是没有设置swap导致MysqLd进程内存溢出,设置swap后MysqLdump运行正常。
错误5:MysqL.user表数据被清空
解决方法:
1.在my.cnf中加入skip-grant-tables,然后重启myqld
2.插入数据到myql.user表
MysqL> insert into user(host,user,password) values('localhost','root',password('123'));
ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value
3.上面报错是因为sql_mode中有STRICT_TRANS_TABLES选项,去掉该选项然后重启MysqLd
4.执行下面的sql
MysqL> insert into user(host,user,password) values('localhost','root',password('123'));
MysqL> update user set select_priv='y', insert_priv='y',update_priv='y',Alter_priv='y',delete_priv='y',create_priv='y',drop_priv='y',reload_priv='y',shutdown_priv='y',Process_priv='y',file_priv='y',grant_priv='y',References_priv='y',index_priv='y',create_user_priv='y',show_db_priv='y',super_priv='y',create_tmp_table_priv='y',Lock_tables_priv='y',execute_priv='y',repl_slave_priv='y',repl_client_priv='y',create_view_priv='y',show_view_priv='y',create_routine_priv='y',alter_routine_priv='y',create_user_priv='y' where user='root';
MysqL> commit;
5.去掉skip-grant-tables参数,然后重启MysqLd
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。