I did not use php mysql for quite a while and now I need to use it again.But problem is I forget the password for mysql console.and getting error #1045 when try to login in phpmyadmin. In mysql site I saw a article how to reset root password( http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-windows)
Steps are
create a mysql-init.txt file containing UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='root';
FLUSH PRIVILEGES;
I saved it as C:\me\mysql-init
and in command prompt I wrote-- C:\wamp\bin\mysql\mysql5.5.8\bin\mysqld --init-file=C:\me\mysql-init.txt
I tried with double back slashes also..but it is not working.mysql console is asking for password and its not taking the new-one.What am I doing wrong?I have several tables there.what to do? Thanks in advance.
try to start mysql with --skip-grant-tables
then connect to your mysqld without username/password using mysql command line
then issue command
If other answer could not help, you can try to uninstall/re-install mysql. It works on my ubuntu server:
Update distribution
And re-install
I couldn't get
mysqld
in Adelave's answer to work. But this worked for me insteadstop and start mysql with --skip-grant-tables
then connect to your mysqld without username/password
then update the password on mysql command line
then restart mysql normally