WordPress无法建立与MariaDB
的连接,而只能与MySQL
连接
持续获取:Can’t select database
如何将Wordpress设置为连接到MariaDB
?
禁用或启用MySQL均无济于事
这也不起作用
答案 0 :(得分:0)
使其正常工作。
我必须将示例配置文件设置为如下所示,并将其另存为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', '' );
瞧! 不知何故,我花了数天和数小时的时间在Google上搜寻,并在各处猛击头,但解决方案是如此简单。