简体   繁体   English

手动更新Wordpress数据库

[英]Manually updating a Wordpress database

I am currently working with a team of developers trying to port our website to WordPress. 我目前正在与一组开发人员合作,试图将我们的网站移植到WordPress。 On our local dev. 在我们的本地开发人员上。 server, we have complete ability to edit MYSQL schema. 服务器,我们完全有能力编辑MYSQL模式。 However, our parent company runs the MYSQL server on our production server, meaning we can't make script-based schema changes. 但是,我们的母公司在生产服务器上运行MYSQL服务器,这意味着我们无法进行基于脚本的架构更改。 Instead if we want to change anything in the MYSQL schema, we have to log the change, and mail it to them. 相反,如果我们想更改MYSQL模式中的任何内容,则必须记录更改并将其邮寄给他们。

This makes upgrading WordPress tricky, since WordPress automatically generates and executes the SQL when it updates. 这使升级WordPress变得棘手,因为WordPress在更新时会自动生成并执行SQL。 We simply can't do this, and need a way to get SQL commands WordPress uses on our local server. 我们根本无法做到这一点,需要一种方法来获取WordPress在本地服务器上使用的SQL命令。

I agree with Pekka웃's comment, but if you really must do this I think the easiest way would be to use MySQL logging. 我同意Pekka웃的评论,但是如果您真的必须这样做,我认为最简单的方法是使用MySQL日志记录。 Turn it on on your local machine, run your upgrade, and check the content of the file. 在本地计算机上打开它,运行升级,然后检查文件的内容。

Depending on what version of MySQL you have, something like this should create a file to use as a base: 根据您拥有的MySQL版本,类似这样的内容应创建一个用作基础的文件:

SET GLOBAL log_output = "FILE";
SET GLOBAL general_log_file = "D:/tmp/mysql.log";
SET GLOBAL general_log = 'ON';

I can't help think getting the parent company to run the upgrade would be much, much better though. 我不禁认为让母公司进行升级会好得多。 Minor differences between dev and production could cause unexpected issues. 开发人员和生产人员之间的微小差异可能会导致意外问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM