nsForum logo

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> Mysql Connection, Database user permissions problem
Hamman
post Nov 7 2009, 03:50 PM
Post #1





Group: Verified NS Member
Posts: 4
Joined: 7-November 09
From: Edmonton, Canada
Member No.: 6,188



I'm a technical consultant for a site hosted on Network Solutions® under the nsHosting Shared (Small-Unix) plan. I encountered a problem with connecting to a database (I'm using PHP for the connection script). Details are below:

Configuration
Server (alias): mysqlv10
Database: some_db
Database user: someuser

Error message
someuser@"%" does not have permission to access some_db

Comments
I logged in via SSH, and determined that "someuser" has permissions to "localhost" ie. If the server was "localhost" the connection script would work. However, the database can only be connected via the DB server's IP or alias, not "localhost". I couldn't find a place to handle user permissions on the control panel, and logging in via SSH again gives me permissions on "localhost" so I can't extend the user's permissions to "mysqlv10".

Suggested Resolution
The problem cannot be resolved by creating another user (because all permissions get set the same way). Either extending "someuser" permissions to "mysqlv10" or enabling access via "localhost" might work (by the way, I've tried this using the DB server IP).
Go to the top of the page
 
+Quote Post
JonB
post Nov 7 2009, 05:17 PM
Post #2


Network Solutions Technical Support


Group: Administrators
Posts: 27
Joined: 23-October 09
From: Drums, PA
Member No.: 5,879



It would be very unusual for what you describe to be happening. The best way to test your ability to connect to the database would be to save this script as "mysql_test.php" in your nsHosting package and visit it. Just be sure to update the script with your database connection specifics. If you get anything except "Connection was successful!" please post the error it so we can take a look at what's going on.

CODE
<?php
/* Modify with your specifics */
$server = "server_alias";    
$user = "db_username";
$pass = "db_password";
$db = "db_name";
$con = mysql_connect($server, $user, $pass) or die(mysql_error());
mysql_select_db($db, $con) or die(mysql_error());
echo "<h3>Connection was successful!</h3>";
?>
Go to the top of the page
 
+Quote Post
Hamman
post Nov 9 2009, 11:27 PM
Post #3





Group: Verified NS Member
Posts: 4
Joined: 7-November 09
From: Edmonton, Canada
Member No.: 6,188



Hi, its all ok now (IMG:http://forums.networksolutions.com/style_emoticons/default/blinking.gif) Wonder what was wrong before then? Thanks
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2009 Time is now: 22nd November 2009 - 06:49 AM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates