我想在mariaDB中对db进行备份,我使用了以下语句,但是做了任何工作。
mysqldump -u root -p -databases messages > dbdescargada.sql
mysqldump -u root -p messages > dbdescargada.sql
mysqldump -u root messages > clients.sql
mysqldump --user='root' --add-locks messages messages > copia.sql
mysqldump --user='root' --add-locks messages messages > copia.sql但所有这些都显示了同样的错误:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'statement' at line 1

我真的需要做这个备份,因为我需要对表结构做重要的更改,我正在使用Xampp,Ubuntu20.04,我知道我可以通过localhost/phpmyadmin实现它,但我也需要一个代码选项
发布于 2020-05-18 18:50:07
你有两个问题:
1)您正在mysql上运行它。mysqldump是一个shell命令,而不是mysql命令。
2)丢失-中的->重定向到文件-在>之前没有减号
发布于 2020-05-18 18:07:36
参数是--数据库
您的图像表明您在mysqlshell中运行了错误的命令,yoz必须在普通命令窗口bash中运行它。
请检查一下参数
mysqldump -u root -p --databases messages > dbdescargada.sqlhttps://stackoverflow.com/questions/61875718
复制相似问题