Home  >  Article  >  Database  >  How to solve 1045 unable to log in to mysql server

How to solve 1045 unable to log in to mysql server

WBOY
WBOYOriginal
2022-08-01 17:47:3410001browse

Solution: 1. Find the "my.ini" system configuration file and put "skip-grant-tables" under "port=****"; 2. If it is placed in the C drive, Then you need editing permissions and save the changes; 3. Restart the service before opening the MySQL database, open the cmd command prompt, directly enter mysql, and press Enter to open the MySQL database.

How to solve 1045 unable to log in to mysql server

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to solve 1045 unable to log in to mysql server

Open MySQL

Enter mysql, as shown below:

How to solve 1045 unable to log in to mysql server

A prompt appears:

ERROR 1045 (28000): Access denied for user ‘ODBC’@‘localhost’ (using password: NO)

means:

Deny access to user "ODBC"@"localhost" (use password: No)

This is not a command to open a MySQL database , so an error will occur. You should use the mysql -u root -p command, and then you will be asked to enter the password. After entering the password, you can enter the MySQL database, as shown below:

How to solve 1045 unable to log in to mysql server

Solution:

1. We find the my.ini system configuration file, open it with Notepad, find [mysqld], and put skip-grant-tables in port=**** Below, as shown below:

How to solve 1045 unable to log in to mysql server

How to solve 1045 unable to log in to mysql server

How to solve 1045 unable to log in to mysql server

##After copying, save it. If you put it in the C drive, Then you need editing permissions, otherwise you will not have permission to save the configuration file.

Right click, click Properties

How to solve 1045 unable to log in to mysql server

Find Security, click Security, the following interface will appear:

How to solve 1045 unable to log in to mysql server

You can see at this point that individual users do not have writing and modifying permissions.

2. Click Edit, find the user personal user, click to enter the user permission editing mode, check the box to the right of the "Write" permission, click OK, and then click OK, as shown in the figure:

How to solve 1045 unable to log in to mysql server

This way you can save the changes.

3, Restart the service before opening the MySQL database, open the cmd command prompt, enter mysql directly, and press Enter to open the MySQL database.

How to solve 1045 unable to log in to mysql server

How to solve 1045 unable to log in to mysql server

Recommended learning:

mysql video tutorial

The above is the detailed content of How to solve 1045 unable to log in to mysql server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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