Go Back   Web Server Hosting Forum by BODHost > Support > MySQL Issues.
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-25-08, 11:23
BOD Member
 
Join Date: Mar 2006
Location: Scotland
Posts: 201
Default Access denied Errors in MySQL

If you face any problem to connect MySQL server,you use folowing steps to correct the problem:

First please make sure that the server is running and if it is not running, you cannot connect to it.
For example, if you are trying to connect to the server and see a message such as one of those following, one cause might be that the server is not running:

shell> mysql
ERROR 2003: Can't connect to MySQL server on 'host_name' (111)
shell> mysql
ERROR 2002: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111)
Reply With Quote
  #2 (permalink)  
Old 02-26-08, 05:04
BOD Member
 
Join Date: Nov 2005
Location: New Mexico
Posts: 273
Default

The server is running, but you cannot connect because you might be trying to connect using a TCP/IP port, named pipe, or Unix socket file different from the one on which the server is listening. you can correct this problem by checking when you invoke a client program, specify a --port option to indicate the proper port number, or a --socket option to indicate the proper named pipe or Unix socket file. You can easily find out where the socket file is, by using this command:

shell> netstat -ln | grep mysql
Reply With Quote
  #3 (permalink)  
Old 02-26-08, 11:26
BOD Member
 
Join Date: Oct 2005
Location: Newcastle
Posts: 155
Default

Here is what i am getting :(

C:\>mysql -uroot mysql
ERROR 1045: Access denied for user: 'root@127.0.0.1' (Using password: NO)

C:\mysql\bin>mysql -u root test
ERROR 1045: Access denied for user: 'root@127.0.0.1' (Using password: NO)

C:\mysql\bin>mysql -h localhost -u root test
ERROR 1045: Access denied for user: 'root@127.0.0.1' (Using password: NO)
Reply With Quote
  #4 (permalink)  
Old 02-27-08, 05:08
BOD Member
 
Join Date: Jul 2007
Posts: 128
Default

Try by logging back in as root to the server and reissue the SQL statement again except with 'username@localhost'.
Reply With Quote
  #5 (permalink)  
Old 02-27-08, 08:16
BOD Member
 
Join Date: Oct 2005
Location: Newcastle
Posts: 155
Default

That doesn't seem to work :(
Reply With Quote
  #6 (permalink)  
Old 02-27-08, 08:25
Moderator
 
Join Date: Oct 2005
Posts: 346
Default

Ok,

this is what i have searched, i am sure this will help :

You need to add the username with SQL as follows :

GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON winestores.* TO username@127.0.0.1 IDENTIFIED by 'password';

Rodricks is very near to a resolution though
Reply With Quote
  #7 (permalink)  
Old 02-28-08, 07:47
BOD Member
 
Join Date: Oct 2007
Posts: 24
Default

Access denied for user ''@'unknown' to database mysql

In this case, you will have to restart the server with the --skip-grant-tables option and edit your /etc/hosts file or \windows\hosts file to add an entry for your host.
Reply With Quote
  #8 (permalink)  
Old 02-29-08, 04:22
Administrator
 
Join Date: Jul 2007
Posts: 85
Default

iF you will get the following error, it means that you are using an wrong root password:

HTML Code:
shell> mysqladmin -u root -pxxxx ver
Access denied for user 'root'@'localhost' (using password: YES)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 01:33.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.