Installing live drupal website in local
This error message is shown when you try to install Drupal, but the Drupal install script detects that there is already a populated (i.e. not empty) database present in the database pointed to by settings.php.

Here is how you set up an empty database to hold Drupal (provided the database is named "drupal").


$ mysql -u root -p
Password:
mysql> DROP DATEBASE drupal;
mysql> CREATE DATABASE drupal;
mysql> GRANT USAGE ON *.* TO drupal@localhost IDENTIFIED BY 'password';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER,
    -> LOCK TABLES, CREATE TEMPORARY TABLES ON drupal.* TO drupal@localhost
    -> IDENTIFIED BY 'password';
mysql> quit
Bye
$


This will create an empty database named "drupal", belonging to a database user named "drupal", with the passord "password". (Choose a more obscure password than "password".)

Then delete settings.php and copy default.settings.php to settings.php.  Do not edit it. Make sure the directory where settings.php lives and settings.php itself is writable by the web server.  That will make the install script create a new settings.php with the correct values during the install.

After doing all this: Start again installing Drupal.

After installation is complete, change the permissions for settings.php and its directory back to safe values.  Check that there are no warnings in the Drupal status report.