Wordpress 无法与 MariaDB
建立连接,只能连接到 MySQL
不断收到:无法选择数据库
如何设置 WordPress 连接到 MariaDB
?
禁用或启用 MySQL 都没有帮助
这也不起作用
最佳答案
成功了。
我必须将示例配置文件设置为如下所示,并将其另存为 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', '' );
瞧! 不知何故,我花了几天和几个小时在谷歌上搜索并到处敲脑袋,但解决方案就是这么简单。
关于php - WAMP WORDPRESS 连接到 MySQL,但不会连接到 MariaDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58351486/