我在本地计算机上使用Acquia Dev Desktop构建了一个Drupal 8站点。我正在AWS EC2上安装Drupal,并且遇到以下错误。
Failed to connect to your database server. The server reports the
following message: SQLSTATE[HY000] [2002] Connection refused.
我已经使用我的config.inc文件检查了数据库名称,用户名,密码和端口,但仍然无法连接它。以下是drupal安装页面的屏幕截图,其中包含错误:
这是我的config.inc文件信息(带有虚拟密码,但真实版本确实与我在Drupal安装页面输入的内容相匹配)
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '33067';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'mypasswordhere';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['AllowUserDropDatabase'] = true;
答案 0 :(得分:0)
Take a look on this answer. Because if you're using RHEL/CentOS machine could be solution.
Edit: RHEL/CentOS or any other EC2 system with SELinux enabled.