简体   繁体   English

在Linux服务器中建立数据库连接的Wordpress错误

[英]Wordpress Error establishing a database connection in Linux server

Hi i have a problem with the Wordpress admin panel. 嗨,我在Wordpress管理面板上遇到问题。 I have istalled mysql and phpMyAdmin on my Linux server. 我在Linux服务器上安装了mysql和phpMyAdmin。 Then i have uploaded my Wordpress file to server using FileZila. 然后,我已经使用FileZila将我的Wordpress文件上传到服务器。 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". 在Linux服务器上安装wordpress后,我运行了主题并使用管理仪表板自定义页面,当我尝试登录“无法登录到MySQL服务器”时,将显示phpAdmin页面。 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? 你可以检查你的wp-config.php文件吗? 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 . 尝试转到/ var / log / php-fpm并检查error.log文件。 In my case, I ran: 就我而言,我跑了:

/etc/init.d/mysqld /etc/init.d/mysqld

status with message : mysqld dead but subsys locked 消息状态:mysqld已死,但子系统已锁定

Turned out that mysql was stopped! 原来mysql已停止! How that happened remains a mystery since I did not change anything. 因为我什么都没改变,所以如何发生仍然是一个谜。 The solution was to simply run: 解决方案是简单地运行:

/etc/init.d/mysqld start /etc/init.d/mysqld开始

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

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