Home > Database > Mysql Tutorial > Detailed graphic and text explanation of the solution to the Mysql ERROR 1045 (28000) error problem in the ubuntu system

Detailed graphic and text explanation of the solution to the Mysql ERROR 1045 (28000) error problem in the ubuntu system

黄舟
Release: 2017-05-21 09:22:42
Original
2539 people have browsed it

This article mainly introduces the ubuntu systemInstallationmysqlLogin prompt to solve Mysql ERROR 1045 (28000): Access denied for user root@ localhost problem, Friends in need can refer to the

first method:

skip-grant-tables: very useful mysql startup parameters

Introducing a very useful mysql startup parameter— — --skip-grant-tables. As the name suggests, grant-tables, the authorization table, is not started when starting
mysql. what's the function? Of course it is useful after forgetting the administrator password.

Start mysql with command line parameters: # /usr/bin/mysqld_safe --skip-grant-tables &

3. Change the administrator password:

use mysql;
update user set password=password('yournewpasswordhere') where user='root'; flush privileges; exit;
Copy after login

4. Kill mysql and restart mysql.

Then you can log in directly

Method 2:

Check the path of mysql installation

Then we change the root user's Password,

Check the default password first

Then log in directly

Then change the root default user name and password

GRANT ALL PRIVILEGES on *.* to 'root'@'localhost' identified by '密码';
flush privileges;
Copy after login
 mysql>update mysql.user set password=password('新密码') where User="test" and Host="localhost";
  mysql>flush privileges;
  mysql>delete from user where User='root' and Host='localhost';
  mysql>flush privileges;
mysql>grant select,delete,update,create,drop on *.* to test@"%" identified by "1234";
mysql> UPDATE user SET Host='127.0.0.1' WHERE User='root' AND Host='localhost';mysql> flush privileges;
Copy after login

Change Grant_priv to 'Y' Yes (flush privileges; (effective after executing this statement or restarting MySQL)), update mysql.user set Grant_priv='Y' where user='ptmind';

The above is the detailed content of Detailed graphic and text explanation of the solution to the Mysql ERROR 1045 (28000) error problem in the ubuntu system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template