Ubuntu VPS in the WordPress Web site open When prompted "to establish a database connection error" solution _php instance

Source: Internet
Author: User
Tags vps ubuntu vps

First, the discovery of problems

When I tried to edit the WordPress theme of the blog site, I suddenly found that the blog site could not connect, and then prompted the error "Establish database connection error" after refreshing. The natural idea is that MySQL may be wrong, so they landed on the VPS host, trying to start the MySQL service, but prompted failed.

Ii. Solutions

1. Open /var/log/mysql/error.log the file and view the error log. When I read the log, I found that the first error message was:[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

2, try to execute mysql_upgrade still prompt error:

Looking for ' MySQL ' as:mysql
looking for ' Mysqlcheck ' As:mysqlcheck
error:failed while fetching Server version! Could is due to unauthorized access.
FATAL Error:upgrade failed

3, so, in search of similar problems on the Internet, found a solution. Enter the command: mysql_install_db --user=mysql --ldata=/var/lib/mysql after it is installed automatically system tables , it can be repaired successfully.

4. At this point, try to start the MySQL service :/etc/init.d/mysql start .

Summarize

The above is in the Ubuntu VPS WordPress web site Open When prompted "set up a database connection error" solution, I hope this article on the content of the same problem with friends can help, if there is doubt you can message exchange.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.