mysql_secure_installation fails ... trying to set root password!

Discussion in 'Webmastering & Programming' started by dalearyous, Jul 16, 2012.

  1. dalearyous

    dalearyous [H]ard|Gawd

    Messages:
    1,915
    Joined:
    Jun 21, 2008
    running centos 6.3

    in terminal i run /usr/bin/mysql_secure_installation

    it starts and then asks Enter current password for root (enter for none):
    so i hit enter

    Y for set root password

    i type in root password twice, fails:
    ERROR 1142 (42000) at line 1: UPDATE command denied to user ''@'localhost' for table 'user'
    Password update failed!

    any ideas?
     
  2. robvas

    robvas Gawd

    Messages:
    579
    Joined:
    Jun 30, 2011
    Stop the MySQL service and then do this:


    rm -fr /var/lib/mysql/*


    Then start it and try to get back in the database. There is probably a password already set, that line will erase it (and your existing databases!)
     
  3. calebb

    calebb 1337 liek JeffK

    Messages:
    8,342
    Joined:
    Mar 26, 2000
  4. dalearyous

    dalearyous [H]ard|Gawd

    Messages:
    1,915
    Joined:
    Jun 21, 2008
    none of the resetting or solutions found by googling worked.

    i simple removed it, deleted the mysql folder, reinstalled