If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > ERROR 1045: Access denied for user: 'root@localhost'

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-15-03, 12:29
andy18 andy18 is offline
Registered User
 
Join Date: Jun 2003
Location: Malaysia
Posts: 12
ERROR 1045: Access denied for user: 'root@localhost'

Hi guys,

When I type mysql on the shell as root , I am getting the error "1045: Access denied for user: 'root@localhost' (Using password: YES) "

I have tried the above steps by restarting the mysql with the --skip-grant-tables access :

root@abc [/var/lib/mysql/mysql]# /etc/rc.d/init.d/mysql start --skip-grant-tables;

root@abc [/var/lib/mysql/mysql]# mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

I have checked the /.my.cnf file and the file is on the root folder.

Any advice will be appreciate .
__________________
Regards,

Andy

I hear and I forget. I see and I remember. I do and I understand
Reply With Quote
  #2 (permalink)  
Old 08-15-03, 13:29
andy18 andy18 is offline
Registered User
 
Join Date: Jun 2003
Location: Malaysia
Posts: 12
Hi,

I have also tried login to MYSQL without password with no avail :

root@abc [/var/lib/mysql/mysql]# mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
__________________
Regards,

Andy

I hear and I forget. I see and I remember. I do and I understand
Reply With Quote
  #3 (permalink)  
Old 08-16-03, 05:25
then then is offline
Registered User
 
Join Date: Aug 2003
Location: FDR India
Posts: 24
AFAIK once grant-tables are skipped, MySQL doesn't care who you are!!, just ./mysql will get you in i.e. don't specify password and host

Any errors when you start mysql server?

Whats in the [client] section of my.cnf? comment out any password there with a #

regards
theN
Reply With Quote
  #4 (permalink)  
Old 08-17-03, 17:58
andy18 andy18 is offline
Registered User
 
Join Date: Jun 2003
Location: Malaysia
Posts: 12
Hi,

Found the cause of the problem !We have included "Special Character ( &%#@ ) "in our MYSQL root password and this had caused the problem . We reset the password without any Special character and it resolved the issue. Thank God !

Steps :

Make sure root pass is in /root/.my.cnf
This is usually the first root pass the box was given once cpanel is installed.
If it still does not work, you will need to reset the mysqld root pass.
First, stop the mysqld, usually /etc/rc.d/init.d/mysql stop
Then stop chkservd to keep it from interfering with mysqld while you work on it with /etc/rc.d/init.d/chkservd stop
Start up mysqld , but, without the grant tables,
mysqld --skip-grant-tables -u mysql &
Then change the pass..

mysql -u root mysql UPDATE user SET Password=PASSWORD('new_password') WHERE user='root';
FLUSH PRIVILEGES;
Now you just killall -9 mysqld and start it up normally with it's safe_mysqld script..

and update your password in /root/.my.cnf

Remember NOT to include "Special Character" in the password !

Hope this help others !
__________________
Regards,

Andy

I hear and I forget. I see and I remember. I do and I understand
Reply With Quote
  #5 (permalink)  
Old 01-08-04, 04:46
carmi carmi is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
Unhappy ERROR 1045: Access denied for user: 'root@localhost'

how can i do that in Redhat Linux?
Reply With Quote
  #6 (permalink)  
Old 01-08-04, 10:47
andy18 andy18 is offline
Registered User
 
Join Date: Jun 2003
Location: Malaysia
Posts: 12
you may do that from SHELL command prompt.
__________________
Regards,

Andy

I hear and I forget. I see and I remember. I do and I understand
Reply With Quote
  #7 (permalink)  
Old 03-06-04, 19:02
timus timus is offline
Registered User
 
Join Date: Mar 2004
Posts: 1
Same Problem on Win2003 server

When I try to change the root password in DOS screen ..I am getting the following error
ERROR 1045: Access denied for user: 'root@localhost.......

What shoudl I do .....?

Thanks

Troy

http://www.miami-realestate.net
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On