MySQL error: accessdeniedforuser 'root' @ 'localhost' usi _ MySQL
Source: Internet
Author: User
MySQL error: accessdeniedforuser bitsCN.com
Mysql was running well. I changed the root password once. it seems that it was not successful. at that time, I didn't care about it, and there was no problem with mysql. The next day, the error "access denied for user 'root' @ 'localhost' using password yes" was reported during startup ". There are many ways to solve the problem on the internet. if you try a few ways, we will post the method after your practice is successful,
The following content is based on the forum. 1. First, go to the windows command line mode. I installed mysql on drive C and switched to the mysql bin directory. The command format is as follows. C code cd C:/program files/mysql server 5.1/bin 2. stop the mysql service and run the following command: C code C:/Program Files/MySQL Server 5.1/bin> mysqld -- defaults-file = "C: /Program Files/MySQL Server 5.1/my. ini "-- console -- skip-grant-tables. if the following result is displayed, the C code Version is successfully started: '5. 1.33-community-log 'socket: ''' port: 3306 MySQL Community Server (GPL) 3. open a dos window and switch to C code C:/Program Files/MySQL Server 5.1/bin> mysql-uroot mysql under the bin directory. The result is as follows: C code Welcome to the MySQL monitor. commands end with; or/g. your MySQL connection id is 2 Server version: 5.1.33-community-log MySQL Community Server (GPL) Type 'help; 'or'/h' for help. type '/C' to clear the buffer.
4. follow these steps and enter C code #/etc/init. d/mysql stop # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking & # mysql-u root mysql> UPDATE user SET Password = PASSWORD ('newpassword ') where USER = 'root'; mysql> flush privileges; mysql> quit #/etc/init. d/mysql restart # mysql-uroot-p Enter password: <输入新设的密码newpassword> Mysql> so far, the password is successfully updated. Author: dseabitsCN.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.