免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1657 | 回复: 0

一次Mysql数据库备份异常处理 [复制链接]

论坛徽章:
0
发表于 2011-12-19 13:55 |显示全部楼层
./mysqlbackup_mxxy.sh 
---------------------------
10-12-31 10:20:25
---------------------------
db101231am.sql
[db1012311020.tar.gz]Backup Success!
[root@urgdl11 shell]# ./mysqlbackup_ssxw.sh 
---------------------------
10-12-31 10:20:57
---------------------------
mysqldump: Got error: 1045: Access denied for user 'admin_ssxw'@'%' (using password: YES) when using LOCK TABLES
db101231am.sql
[db1012311020.tar.gz]Backup Success!
[root@urgdl11 shell]# vim mysqlbackup_ssxw.sh 
[root@urgdl11 shell]# mysql -uadmin_ssxw -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 795
Server version: 5.1.46-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| daily_ssxw         |
| test               |
+--------------------+
3 rows in set (0.00 sec)

mysql> exit
Bye
[root@urgdl11 shell]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 796
Server version: 5.1.46-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> grant all privileges on daily_ssxw.* to admin_ssxw@"localhost" identified by 'daily1523';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@urgdl11 shell]# ./mysqlbackup_ssxw.sh 
---------------------------
10-12-31 10:27:03
---------------------------
mysqldump: Got error: 1045: Access denied for user 'admin_ssxw'@'localhost' (using password: YES) when using LOCK TABLES
db101231am.sql
[db1012311027.tar.gz]Backup Success!
[root@urgdl11 shell]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 798
Server version: 5.1.46-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> grant all privileges on *.* to admin_ssxw@"localhost" identified by 'daily1523';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@urgdl11 shell]# ./mysqlbackup_ssxw.sh 
---------------------------
10-12-31 10:28:09
---------------------------
mysqldump: Got error: 1449: The user specified as a definer ('admin'@'%') does not exist when using LOCK TABLES
db101231am.sql
[db1012311028.tar.gz]Backup Success!

======================================
grant all privileges on *.* to admin@"%" identified by 'daily1523';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP