恢复转储时 WordPress MySQL 数据库连接错误
我想使用 mysqldump/mysql 转储和还原 Azure for MySQL 中托管的 WordPress 数据库。 以下是我遵循的步骤:
我转储了名为 wordpress 的数据库:
mysqldump.exe -Fc -v --column-statistics=0 -h host -u user -p -d wordpress > wordpress_backup.sql
然后删除了数据库:
drop database wordpress;
然后创建了数据库:
create database wordpress;
然后,我将转储恢复到数据库:
mysql.exe -h host -u user -p wordpress < wordpress_backup.sql
在此过程之后,WordPress 无法连接到数据库,导致这个错误:
我已经检查过数据库引擎是 InnoDB,并且还尝试了不同的字符集/排序规则组合(以匹配 WordPress 配置),但这些都不起作用。
这可能是什么原因?
I want to dump and restore a WordPress database hosted in Azure for MySQL using mysqldump/mysql.
Here are the steps I have followed:
I dumped database named wordpress:
mysqldump.exe -Fc -v --column-statistics=0 -h host -u user -p -d wordpress > wordpress_backup.sql
then I removed the database:
drop database wordpress;
then I created the database:
create database wordpress;
and then, I restored the dump to the database:
mysql.exe -h host -u user -p wordpress < wordpress_backup.sql
After this process, WordPress is unable to connect to the database, leading to this error:
I have checked that database engine is InnoDB and also tried different charset/collation combinations (to match WordPress config) but none of these work.
What could be the reason for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是我在 mysqldump 命令末尾留下了 -d 标记,这意味着转储中不包含数据。来自官方文档:
The problem was I left -d tag at the end of mysqldump command, which means data is not included in the dump. From official documentation: