By sm5574 on
I was making changes to my local copy of Drupal, which connects to a database on localhost. I copied my changes to the main server, but I accidentally overwrote the settings.php file, and now I can't get it to connect to the MySQL server (which is on an external server).
[Edit: To clarify, I don't remember what I had in the original settings.php...this is what I have been trying.]
$db_url = 'mysql://username:pass@XXX.XXX.XXX.XXX/database';
It says it can't connect to the server. What should I do?
Comments
it wants your database info
when you created the database, it had a 'database username', 'database password', 'database location' and a 'database name'.
Just put those in place and it should work fine.
$db_url = 'mysql://username:password@localhost/databasename';
$db_url = 'mysql://database_username:database_password@database_location/database_name';
If you do not have the info written down,, goto phpmyadmin, click the database on the left that holds Drupal(that is the database name).
Then look at the top and it will say where the database is located.. www.examplemsql.com or something like that.
Click the Privileges tab to see the username.
And for the password, if it's not written down, you can make a new one.
additional thought
when moving or changing a site, the 'sites' folder gets special attention every time.
I have done the same thing, it only takes once to learn that one..lol