简体   繁体   中英

Wordpress gives me "Error establishing a database connection" after I resolve "MySQL shutdown unexpectedly" error in Xampp

I started to use WordPress in localhost a few weeks ago to realize a website for my degree thesis.

Yesterday, I started running Xampp but the function MySQL stopped immediately, with the following error:

Error: MySQL shutdown unexpectedly.
02:06:56 [mysql] This may be due to a blocked port, missing dependencies
02:06:56 [mysql] improper privileges, a crash, or a shutdown by another method.
02:06:56 [mysql] Press the Logs button to view error logs and check
02:06:56 [mysql] the Windows Event Viewer for more clues
02:06:56 [mysql] If you need more help, copy and post this
02:06:56 [mysql] entire log window on the forums

I managed to solve the problem replacing the Data folder in the Xampp files.
I renamed the Data folder in "Data_old", so I created a new "Data" folder. I copied the backup files in the new "Data" folder and, after that, I copy and pasted the site folder and the file " ib_logfile1 " from the "Data_old".

When I tried to running MySQL function, it started without problems. But, when I tried to enter in Wordpress, it gives me " Error establishing a database connection ".
How can I solve it?

Using MAMP but this error reminds me of a case I've encountered some time ago. In my case some references in the DB turned out to be the issue. Can you check if the permalinks in the {tableprefix}_posts table are correct? You can do so through DirectAdmin in xamp.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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