Mysql – How to take backup of a database in thesql

mysqldump

For Back up I have used the following commands.

mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

mysqldump -u [username] -p[root_password] --single-transaction
 --routines --triggers --lock-tables [database_name] > backup.sql;

Getting same error:

mysqldump: Couldn't execute 'show table status like 'uc_order_products_pair_vw'': SELECT command denied to user 'username'@'localhost' for column 'nid' in table 'uc_order_products' (1143)

After running select * from mysql.tables_priv;

enter image description here

Best Answer

Can you try grant permission on whole database like,

GRANT ALL PRIVILEGES ON db.* TO 'username'@'%' IDENTIFIED BY 'yourpass' WITH GRANT OPTION;