我正在尝试备份数据库。我在 Windows 10 上打开 MariaDB 客户端控制台,输入 root 密码,然后输入:
MariaDB [(none)]> mysqldump database_name > backup.sql;
它返回此错误:
ERROR 1064 (42000): 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 'mysqldump database_name > backup.sql' at line 1
我做错了什么?
最佳答案
尝试使用
mysqldump -u root -p database_name > file.sql
在登录数据库之前(新的 CLI 窗口)。执行此命令后,您必须输入 root 密码
您应该能够在任何 CLI 中运行此命令,例如 CMD.exe 或 Git Bash - 取决于您在计算机上安装东西的方式。我希望这有帮助
关于mysql - 无法使用 MariaDB 控制台进行备份,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37779602/