MySQL Server password reset.

Discussion in 'Installation/Configuration' started by CJMostert, Aug 7, 2006.

  1. CJMostert

    CJMostert New Member

    Hallo
    I have tried EVERY THING!!! I followed the setup:http://www.howtoforge.com/perfect_setup_fedora_core_5_p4 but thought to provide a secure pass for my MYSQL SERVERand forgot that Linux uses special chrs (last did linux 7 years ago) so I messed it up. However only realised it when i tried to install ISPCongfig.

    I tried to follow the guid on resetting mysql from:http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html but when I do step 4: mysqld_safe --init-file=~/mysql-init & It seems nothing happens... Ok some stuff do happen but I do not get my command prompt back!?

    I even tried uninstalling and re installing MYSQL but it seems to remember the SQL password.

    Please help!
     
  2. CJMostert

    CJMostert New Member

    More info

    O btw this is what my terminal show after the "mysqld_safe --init-file=~/mysql-init &" command:

    Starting mysqld daemon with databases from /var/lib/mysql
    STOPPING server from pid file /var/run/mysqld/mysqld.pid
    060807 17:47:50 mysqld ended


    But then the terminal cursos just sit and blink on a blank line and nothing happens.

    Thanx
     
  3. themachine

    themachine New Member HowtoForge Supporter

    Hello,

    I am not sure which distro you are using, but the following should work:

    add 'skip-grant-tables' to the MySQL server's 'my.cnf' usually found at '/etc/my.cnf. Needs to go under the '[mysqld]' section. Similar to:

    Code:
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1
    skip-grant-tables
    

    Then restart MySQL:

    Code:
    /etc/init.d/mysql restart
    

    You should then be able to login to mysql without a password:

    Code:
    linuxbox /]# mysql
    mysql>
    

    Now flush privileges (This clears privileges back to where they should be without 'skip-grant-tables')

    Code:
    mysql> FLUSH PRIVILEGES;
    

    Then reset the root user's password:

    Code:
    mysql> SET PASSWORD FOR 'root'@'localhost'=PASSWORD('password');
    

    Where 'password' is the cleartext password you want to set for root@localhost


    Now remove 'skip-grant-tables' from '/etc/my.cnf' and you are all set.
     
  4. falko

    falko Super Moderator Howtoforge Staff

  5. CJMostert

    CJMostert New Member

    Reinstallinf Fedora 5

    Hallo all
    It was much quicker to reinstall the Fedora 5... I did it in 3 or so hours thanx in any case:)
     

Share This Page