WAMP WORDPRESS 连接到 MySQL,但不会连接到 MariaDB

Eri*_*est 1 php mysql wordpress database-connection mariadb

Wordpress 无法建立连接,MariaDB仅连接到MySQL\n继续获取:Can\xe2\x80\x99t select database\n如何设置 Wordpress 连接到MariaDB

\n\n

在此输入图像描述

\n\n

禁用或启用 MySQL 也没有帮助

\n\n

在此输入图像描述

\n\n

这也不起作用

\n\n

在此输入图像描述

\n\n

这是 PhpMyAdmin 数据库视图\n在此输入图像描述

\n

Eri*_*est 6

成功了。我必须将示例配置文件设置为如下所示并将其另存为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', '' );
Run Code Online (Sandbox Code Playgroud)

瞧!不知何故,我花了几天和几个小时在谷歌上搜索并到处敲脑袋,但解决方案就是这么简单。