Random error: # 1045 Unable to login to MySQL server

I had mysql for a month. I used it yesterday, and today I go to login via phpmyadmin and on the command line, and I suddenly cannot. It was as if someone had changed my password for the night or something like that. I am trying to login using the root user. What should I do?

Edit

This is mysql, which only works on my local development laptop. The only account on it is the root account, and cap locking is not enabled.

+1
mysql
source share
2 answers

I used the link provided by raina77ow and followed the reset instructions for my password, and now it works.

Scroll down to section C.5.4.1.3. Resetting the root password: general instructions were especially helpful.

0
source share

http://www.cyberciti.biz/tips/recover-mysql-root-password.html says that this five-step process will work, try at your own risk, obviously . This source also has the same steps. It probably won't work on windows, but something like this should http://www.debian-administration.org/articles/442

Stop the mysql service with /etc/init.d/mysql stop

Start mysql without password using mysqld_safe --skip-grant-tables &

Connect to the server using mysql -u root

Change root password:

 mysql> use mysql; mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; mysql> flush privileges; mysql> quit 

Stop server: /etc/init.d/mysql stop

Start the server: /etc/init.d/mysql start

Test: mysql -u root -p

+2
source share

All Articles