SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changin MySQL Root Password

    Hi,

    I am a beginner to MySQL and trying to follow Kevin's book. I installed Apache, PHP and MySQL without any problem. I changed the root password using this line:

    Code:
    mysqladmin -u root -p password "newpassword"
    Now, when I open MySQL Command Line Client, I can login with my password and it gives error when I type something different other than the password. However, I can also login without typing any password. Is this normal? Is this what it is supposed to be?

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Location
    Dublin, Ireland
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try restarting your MySQL server to ensure it picks up on the new changes.

    When you say that you can login without a password, what commands are you using?

    Can you select a database and perform a simple SQL command e.g. select * from <table_name> ?

    Wil.

  3. #3
    Non-Member
    Join Date
    Apr 2004
    Location
    Miami, FL, USA
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To restart MySQL:

    /etc/init.d/mysql restart

    If that doesn't solve it, try (in MySQL):

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');

    Then restart MySQL again.

    If that doesn't work, then try:

    SET PASSWORD FOR 'root'@'%' = PASSWORD('mypass');

    And restart again lol.

  4. #4
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you both, restarting the system worked. Now it doesn't login without entering my password.


Bookmarks

Posting Permissions

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