mysql — mysqldump错误:Got error: 1044: Access denied for user … when using LOCK TABLES

使用mysqldump备份数据时如果碰到如下错误提示:

Got error: 1044: Access denied for user … when using LOCK TABLES

那可能是你用来备份的数据库用户没有lock table的权限,可以换一个权限更高的用户,或者使用mysqldump的另一个选项:–single-transaction

mysqldump -uyourusername -pyourpassword –single-transaction yourdb > yourdb.sql

 

参考资料:http://bugs.mysql.com/bug.php?id=21527

添加一条评论 »本文共 2 条评论

  1. mysqldump -uroot -pxxxxxx –all-databases –single-transaction> allbackupfile.sql

    • mysqldump -uroot -pxxxxxx –all-databases –single-transaction > allbackupfile.sql

WordPress数据库查询SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC 时发生Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'jingjing.wp_posts.post_date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by错误,这是由require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/green-hope/single.php'), get_sidebar, locate_template, load_template, require_once('/themes/green-hope/sidebar.php'), dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, WP_Widget_Archives->widget, wp_get_archives查询的。

Copyright © All Rights Reserved · 菁菁博客 Since 2012 · Proudly powered by WordPress