mysqldump error message

database backup:

mysqldump  -u root -p 123456  test > /var/lib/mysql/backups/test_20190327.sql

Execute this backup command, the error message is as follows:

mysqldump: Got error: 1049: Unknown database '123456' when selecting the database

Error reason:
The password does not need to be specified, the execution statement will prompt, and the password written here will be treated as the database name, so modify the backup statement:

mysqldump  -u root -p   test > /var/lib/mysql/backups/test_20190327.sql

Press Enter to enter the password, and you can back up without reporting an error.

If the error is still reported during execution, please confirm whether you have entered the mysql environment. If you enter the mysql environment mysql>, the entered statement belongs to the sql statement, and a semicolon (";") must be added at the end, and it will not be executed under the doc command. A semicolon (";") is required.

Continue to execute, and report the following error message:
mysqldump: Got error: 1356: View 'test.active_rule_max_view' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them when using LOCK TABLES

Cause of error:
The view references an invalid table, column, function or definer, modify the view or rebuild the view, and execute it again, the backup is successful

Guess you like

Origin blog.csdn.net/quanqxj/article/details/88837815