0

I have already installed LAMP in my Ubuntu 18.10 server. I have also downloaded Drupal 7 files. But after I navigate to http://10.0.34.74/drupal-7.65/ in my browser. The error below occurs:

Error
The website encountered an unexpected error. Please try again later. 

PDOException: SQLSTATE[HY000] [2002] Connection refused in lock_may_be_available() (line 167 of /var/www/html/drupal-7.65/includes/lock.inc).

Below are the configuration settings I edited in my settings.php file :

$databases = array (
             'default' => array (
                          'default' => array (
                                       'database' => 'pizzago',
                                       'username' => 'root',
                                       'password' => '1234',
                                       'host' => '10.0.34.74',
                                       'port' => '',
                                       'driver' => 'mysql',
                                       'prefix' => '',
                                       ),
                          ),
              );

Do I have to put something on the port? I have make sure that MySQL is running. Actually I have log in on it using:

 MySQL -u root -p

I have also created an empty database named pizzago. Where am I missing?

P.S:

The password above is not true.

UPDATE :

When I tried changing database host to localhost, since my database is just within the server. Another error occurs:

 PDOException: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' in lock_may_be_available() (line 167 of /var/www/html/drupal-7.65/includes/lock.inc).
  • 1
    In the $databases array try using localhost as a value for the 'host' instead of the IP. – AjitS Mar 27 at 7:12
  • 1
    Just ensure "pizzago" database is already created in your local mysql server. And then try giving mysql port '3306' and host is 'localhost'. – user15837 Mar 27 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.