简体   繁体   中英

Wordpress Error establishing a database connection in Linux server

Hi i have a problem with the Wordpress admin panel. I have istalled mysql and phpMyAdmin on my Linux server. Then i have uploaded my Wordpress file to server using FileZila. After i installed my wordpress in the Linux server i ran the theme and customize the page using admin dashboard, the phpAdmin page showing when i tried to login "Cannot log in to the MySQL server". After that nothing is working in my page. And in my page first time it show following error. 在此处输入图片说明

and after that it showing always following error 在此处输入图片说明

i don't know what is happening. Please help me to find the error.

can you check your wp-config.php file? see if got correct info. should be something like this.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', '');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Try going to /var/log/php-fpm and checking error.log file . In my case, I ran:

/etc/init.d/mysqld

status with message : mysqld dead but subsys locked

Turned out that mysql was stopped! How that happened remains a mystery since I did not change anything. The solution was to simply run:

/etc/init.d/mysqld start

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