1

I installed virtualmin on a VM instance using google compute engine. I have set up 1 domain and 1 subdomain. On the subdomain i created a database (flexijobs) and added the Drupal tables. Everything works fine except the connection to the database. On loading the drupal index page i get this error:

PDOException: SQLSTATE[HY000] [2002] Connection timed out

My guess is that the settings are not correct, so in a virtualmin setup, what should i use here, where can i set the password/user, what port should i use, what is the host?

$databases['default']['default'] = array (
  'database' => 'flexijobs',
  'username' => 'someUsername',
  'password' => 'somePassword',
  'prefix' => '',
  'host' => 'db.somedomain.com',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);
Osvaldo
  • 473
  • 1
  • 12
kevinius
  • 4,232
  • 7
  • 48
  • 79

1 Answers1

0

Create a new database through Webmin > Servers > MariaDB Database Server enter image description here

Note the name, username and password for the database you just made and modify the configuration file to include the information for your database. The host field should be set to localhost

$databases['default']['default'] = array (
  'database' => 'database_name',
  'username' => 'db_username',
  'password' => 'db_password',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);
Mehrdad Moradi
  • 521
  • 1
  • 6
  • 21