[英]“Error establishing a database connection” Wordpress after I installed a new database
I was making a website through WordPress and everything was ok; 我当时是通过WordPress建立的网站,但一切正常。 the DB was on the port 3306. Two days ago, I had to install a DB on my pc for my job and it is on port 3306 so I changed the Wordpress's Db port into 3316 in my.ini but since then when I open my WP website it appears this: Error establishing a database connection 数据库位于端口3306上。两天前,我必须在PC上安装数据库以用于工作,并且数据库位于端口3306上,因此我在my.ini中将Wordpress的Db端口更改为3316,但从那时起我打开WP网站上显示如下:建立数据库连接时出错
What else am I supposed to change? 我还应该改变什么?
It's important that the db of my job stays on port 3306 重要的是我的工作数据库必须保留在端口3306上
Try changing the MySQL port in wp-config.php
; 尝试在wp-config.php
更改MySQL端口; WP is looking for the port there, rather than in my.ini. WP正在那里寻找端口,而不是在my.ini中。
Try: 尝试:
For localhost: 对于本地主机:
define( 'DB_HOST', '127.0.0.1:3316' ); define('DB_HOST','127.0.0.1:3316');
or in some cases: 或在某些情况下:
define( 'DB_HOST', 'localhost:3316' ); define('DB_HOST','localhost:3316');
For specified server: 对于指定的服务器:
define( 'DB_HOST', 'mysql.example.com:3316' ); define('DB_HOST','mysql.example.com:3316');
See https://codex.wordpress.org/Editing_wp-config.php#MySQL_Alternate_Port 参见https://codex.wordpress.org/Editing_wp-config.php#MySQL_Alternate_Port
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.