【发布时间】:2020-02-09 14:03:06
【问题描述】:
Wordpress 无法建立到MariaDB 的连接,只能连接到MySQL
继续获取:Can’t select database
如何设置 Wordpress 连接到MariaDB?
禁用或启用 MySQL 也无济于事
这也行不通
【问题讨论】:
标签: php mysql wordpress mariadb database-connection
Wordpress 无法建立到MariaDB 的连接,只能连接到MySQL
继续获取:Can’t select database
如何设置 Wordpress 连接到MariaDB?
禁用或启用 MySQL 也无济于事
这也行不通
【问题讨论】:
标签: php mysql wordpress mariadb database-connection
搞定了。
我必须将示例配置文件设置为如下所示并将其保存为wp_config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wp_db' );
/** MySQL database username */
define( 'DB_USER', 'root' );
/** MySQL database password */
define( 'DB_PASSWORD', '' );
#Here is the MOST IMPORTANT of all
/** MySQL hostname */
define( 'DB_HOST', 'localhost:3307' );#IMPORTAT: Notice the :3307 that is the PORT for MariaDB
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
还有,瞧! 不知何故,我花了数天又数小时在谷歌上搜索,到处敲我的头,但解决方案就是这么简单。
【讨论】:
localhost:3308