By mopi on
Hello friends
I'm trying to connect to a database that is on another server. Here's my connection string in settings.php
$db_url = 'mysql://root:@192.168.130.133/drupal';
This gives me
"Unable to connect to database server" ... "The MySQL error was: Host '192.168.130.1' is not allowed to connect to this MySQL server. Currently, the username is root and the database server is 192.168.130.133."
Notice how the ip-adress has been truncated in one instance of the message. Clearly it doesn't like an ip-adress there.
How do I connect to a database that is not localhost?
Comments
Host permissions
Hi there
No truncation - you are on machine 192.168.130.1 and you are trying to connect to the MySQL server on 192.16.130.133
Check your host permissions for the MySQL server - the allowed host range must read something like
192.16.130.
OR
.our_domain_name
(Note the position of the ".")
Also check what you are allowed to do in the database - you should as a minimum have EXECUTE rights (OK, as far as I know!)
TIP: Install the program Webmin - it has a nice interface to configure MySQL server
Trust this help!
Database permissions
Also check if your "database permissions" for your database "drupal" have a user defined as "root" and that user "root" has "All" permissions
Trust this help!
Sweetness!
That did the trick. Thanks!
while you are at it, create
while you are at it, create a different mysql user.
www.thelinuxuser.com
will do
This is just a test server anyway. But on a live server I will sure use another user.
Good tip!