Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2003
    Location
    Malaysia
    Posts
    12

    Unanswered: 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

  2. #2
    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

  3. #3
    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

  4. #4
    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

  5. #5
    Join Date
    Jan 2004
    Posts
    1

    Unhappy ERROR 1045: Access denied for user: 'root@localhost'

    how can i do that in Redhat Linux?

  6. #6
    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

  7. #7
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •