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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access is denied for user '@localhost'

Status
Not open for further replies.

tj1590

Programmer
Jun 30, 2000
1
US
I prolly am just doing something small that is incorrect.&nbsp;&nbsp;But using the mysql client 3.22.32 (server is same version)<br>I created a database called chatusers and then created a table using the create table command.&nbsp;&nbsp;if i launch mysql I connect just fine, but if try to connect to the chatusers database thiat I created I get an error Access is denied for user '@localhost'.&nbsp;&nbsp;If I say use the -u ptions i get the same error.<br><br>Any help is apprecieated
 
I had the same problem and dug to find the solution.&nbsp;&nbsp;First, if you made any user for your 'chatuser' database (check the msSQL database user), you may want to delete them and start over.<br><br>here is how it is done:<br><br>Login to the mySQL database (guess as the admin account - someone that has all the access).<br><br>Enter the following<br>-------------------------------------------------<br><br># -- Making user=chatAdmin, password=password<br><br># -- Added the user from the local account (mySQL bug I think) ----<br>GRANT ALL PRIVILEGES ON chatusers.* TO chatAdmin@localhost<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDENTIFIED BY 'password' WITH GRANT OPTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>#-- Now make the user so that they can login from elsewhere&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>GRANT ALL PRIVILEGES ON chatusers.* TO chatAdmin@&quot;%&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDENTIFIED BY 'password' WITH GRANT OPTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br># -- Done: login from command line: <br># --&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mysql chatusers -u chatAdmin -p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br><br>-------------------------------------------------<br><br>That should do it for you.&nbsp;&nbsp;Don't know if you still need this info.&nbsp;&nbsp;I just started with mySQL this weekend and found this board.&nbsp;&nbsp;But if you don't, others might.&nbsp;&nbsp;<br><br>David Genrich<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top