Archiwum kategorii: mysql

mysqldump: 1044 Access denied when using LOCK TABLES

Ostatnio, przenosząc stony webowe jednego z klientów natknąłem się w sumie na prosty, lecz irytujący problem. Podczas wykonywania mysqldump, otrzymywałem błąd:

mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES

I co zrobić w takim wypadku. 
Czytaj dalej

MySql – przywracanie praw konta root’a

restore / repair / reset mysql root privileges

cat > restore_root_privileges.sql
update mysql.user set Super_priv=’y’ where user=’root’;
update mysql.user set Select_priv=’y’ where user=’root’;
update mysql.user set Insert_priv=’y’ where user=’root’;
update mysql.user set Update_priv=’y’ where user=’root’;
update mysql.user set Delete_priv=’y’ where user=’root’;
update mysql.user set Create_priv=’y’ where user=’root’;
update mysql.user set Drop_priv=’y’ where user=’root’;
update mysql.user set Reload_priv=’y’ where user=’root’;
update mysql.user set Shutdown_priv=’y’ where user=’root’;
update mysql.user set Process_priv=’y’ where user=’root’;
update mysql.user set File_priv=’y’ where user=’root’;
update mysql.user set Grant_priv=’y’ where user=’root’;
update mysql.user set References_priv=’y’ where user=’root’;
update mysql.user set Index_priv=’y’ where user=’root’;
update mysql.user set Alter_priv=’y’ where user=’root’;
update mysql.user set Show_db_priv=’y’ where user=’root’;
update mysql.user set Super_priv=’y’ where user=’root’;
update mysql.user set Create_tmp_table_priv=’y’ where user=’root’;
update mysql.user set Lock_tables_priv=’y’ where user=’root’;
update mysql.user set Execute_priv=’y’ where user=’root’;
update mysql.user set Repl_slave_priv=’y’ where user=’root’;
update mysql.user set Repl_client_priv=’y’ where user=’root’;
update mysql.user set Create_view_priv=’y’ where user=’root’;
update mysql.user set Show_view_priv=’y’ where user=’root’;
update mysql.user set Create_routine_priv=’y’ where user=’root’;
update mysql.user set Alter_routine_priv=’y’ where user=’root’;
update mysql.user set Create_user_priv=’y’ where user=’root’;
sudo /etc/init.d/mysql stop
sudo mysqld_safe –skip-grant-tables &
mysql -vv < restore_root_privileges.sql
sudo /etc/init.d/mysql restart
mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’localhost’ WITH GRANT OPTION;
mysql> quit;
(The password of the “debian-sys-maint” user is : sudo cat /etc/mysql/debian.cnf )