Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Host not allowed to connect

Status
Not open for further replies.

zeero

Programmer
Aug 4, 2004
60
US
Hi all, I have this problem when trying to connect to a database with the username "root" with a JSP file I wrote.

"Host '...' is not allowed to connect to this MySQL server"

Sounds like a security/permission thing. Any ideas how to allow access?

Thanks
 
Adding a user and associated privileges the hard way:(?)

from a command prompt:
#>mysql

At the 'mysql>' prompt:

use mysql;
insert into host values ("<hostname/ip>", "%", "Y", "Y", "Y", "Y", "Y","Y");
insert into user values ("<hostname/ip>", "<username>",
password("<password>"), "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y");

NOTE: The "Y" fields above define the privilages that the user or host has
to select/insert/drop/etc tables from the database. Please see the user &
host table headers if you need to change these.

*exit mysql by typing 'quit'*

For host/user/pass changes to take effect, you need to reload the MySQL
grant tables. To do this, type:
"mysqladmin reload" from the shell prompt.

If in doubt check the manual at
Rule No1 applies. You break it , you fix it.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Wouldn't it be better to use the 'GRANT' command to do this? Coming from an Oracle background, this mysql mentatality of directly manipulating grant tables is highly disconcerting.
 
probably ericbrunson, hence the note on the hardway(tm) :)

I guess its what you're used to.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
How do I reload the MySQL grant tables under windows?
 
mysqladmin reload" from the shell prompt.


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top