MySQL Forums
Forum List  »  MySQL Administrator

Re: Unable to connect via browser but able to connect via command
Posted by: Ronan Cashell
Date: July 20, 2011 05:02PM

When creating a user account in MySQL it is possible to provide similar usernames, with the same or different passwords depending on where they are logging in from. If you check the mysql.users table you will see the Host and User columns. These two columns are used when determining access. I think this is best explained using an example:

Imagine I have the following users in the system:

User Host
Ron localhost
Ron example.com
Ron %

Note these are three different users. MySQL authentication will attempt to identify the one that matches your login username and host combination to see which one to use. Let us say we are logging in from localhost with the user Ron then the first entry will be used. If we login from example.com then the second entry will be used for authentication. Finally any other connection with that user from any other host will use the 3rd entry.

In your case it is very likely that you have only one entry in the users table for localhost only. As a result, you can connect from localhost but not from any other host. You will need to add another entry to the database or change the one that exists there (using the wildcard % as host).

Hope this helps

Ronan Cashell
Senior Oracle/MySQL Administrator
IT Integrated Business Solutions
http://www.it-iss.com

Options: ReplyQuote


Subject
Written By
Posted
Re: Unable to connect via browser but able to connect via command
July 20, 2011 05:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.