无法连接到 MySQL 数据库服务器

时间:2021-02-27 23:45:13

标签: mysql sql wordpress

我已经部署了一个 MySQL 数据库服务器,并想将它连接到我的 WordPress 应用程序。我已经更改了 /etc/mysql/mysql.conf.d/mysqld.cnf 中的 MySQL 配置并注释了 bind-address 或将 bind-address 值从 127.0.0.1 更改为 0.0.0.0。我还尝试将 bind-address 值更改为使用数据库的远程服务器应用程序的 IP。

我也已经授予用户权限:

GRANT ALL PRIVILEGES ON `database`.* TO 'user'@'localhost';

GRANT ALL PRIVILEGES ON `database`.* TO 'user'@'remotehost';

这是 wp-config.php 中的 WordPress 数据库配置:

/** The name of the database for WordPress */
define( 'DB_NAME', 'databasename' );

/** MySQL database username */
define( 'DB_USER', 'username' );

/** MySQL database password */
define( 'DB_PASSWORD', 'password' );

/** MySQL hostname */
define( 'DB_HOST', 'remotehost' );

/** 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', '' );

我想念什么?

0 个答案:

没有答案