Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Hi Am using ubuntu server & mysql. Today i just reset my root mysql password. Till that i can able to connect mysql databse via Toad tool but now i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    40

    MYSQL Database Error:


    Hi Am using ubuntu server & mysql. Today i just reset my root mysql password. Till that i can able to connect mysql databse via Toad tool but now i cant able to connect once i reset my mysql root password.

    Am getting error like "Unable to connect to any of the specified MySQL hosts."

    Please reply to get the solution as soon as posible.

    Thanks in advance

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    If I understand correctly:
    You changed the mysql root pw
    and now you cannot connect to the mysql server via toad.

    First thought would be: Did you change the password in toad as well?
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    40
    Thanks For your reply.

    Yeah I changed the password in TOAD also. But am getting the same error

    By this command line I reset my mysql root password.

    sudo /etc/init.d/mysql stop
    sudo service mysql stop
    sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
    mysql -u root
    FLUSH PRIVILEGES;
    USE mysql;
    UPDATE user SET Password = PASSWORD('password') WHERE Host = 'localhost' AND User = 'root';
    FLUSH PRIVILEGES;
    exit;
    sudo /etc/init.d/mysql restart

    Whether any privileges problem??

    Actually am using seperate username & password for each database. Before i reset my root password, toad works fine but after i reset my root password only its not working. But i can access my database from phpmyadmin

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    This updates the pw of root on localhost.
    Does toad connect to mysql via localhost? aka: Is toad on the same machine as the mysql daemon?

    If not, then the old password might still work.
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Jul 2012
    Posts
    40
    No actually I have my mysql databse server in Ubuntu Server. Am using windows machine to connect mysql database from TOAD. Before i Changed my mysql root password i can connect properly But after i changed my mysql root password I cant able to connect ubuntu server mysql database from windows machine using toad. I Think instead of "localhost" have to use my ipaddress while changing my root password??

  6. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    Again: This sql statement only changed the pw for root@localhost
    Code:
    UPDATE user SET Password = PASSWORD('password') WHERE Host = 'localhost' AND User = 'root';
    So a remote connect from a windows host (toad) to the mysql daemon shouldnt be affected.
    But as this apparently is the case:
    - Does localhost on windows side resolve to 127.0.0.1?
    - Does localhost on linux side resolve to 127.0.0.1?
    - Is there maybe a tunnel or port forwarding in place?
    You must always face the curtain with a bow.

  7. #7
    Just Joined!
    Join Date
    Jul 2012
    Posts
    40
    Quote Originally Posted by Irithori View Post
    Again: This sql statement only changed the pw for root@localhost
    Code:
    UPDATE user SET Password = PASSWORD('password') WHERE Host = 'localhost' AND User = 'root';
    So a remote connect from a windows host (toad) to the mysql daemon shouldnt be affected.
    But as this apparently is the case:
    - Does localhost on windows side resolve to 127.0.0.1?
    - Does localhost on linux side resolve to 127.0.0.1?
    - Is there maybe a tunnel or port forwarding in place?
    Thanks for your reply. Sorry for the delay.

    Actually i no tunnel or port forwarding & localhost resolves 127.0.0.1 on both. For the past one month it works fine. I feel today morning after the changed my mysql root password only i got this toad error. I dont knw whats going now.

  8. #8
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    I would start testing the connect and login on the ubuntu box with the mysql command.
    First without -h, then with -h 127.0.0.1, then -h localhost, then -h <external_ip>, then -h <hostname>

    If that succeeds, then do similar tests on the windows machine, of course only with <external_ip> and <hostname>
    You must always face the curtain with a bow.

  9. #9
    Just Joined!
    Join Date
    Jul 2012
    Posts
    40
    Thanks

    but am getting error like

    root@prodserver:~# mysql -h 10.0.9.7 -u root -p
    Enter password:
    ERROR 2003 (HY000): Can't connect to MySQL server on '10.0.9.7' (111)

    root@testuatserver:/# mysql -h 127.0.0.1 -u root -p
    Enter password:
    ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

  10. #10
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    Check if the daemon is running and if yes: On which IP and port it is listening
    You must always face the curtain with a bow.

Page 1 of 2 1 2 LastLast

Posting Permissions

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