Frequently asked questions Access denied for user ''@'localhost' to database 'web02' //web02 is a database I created myself Cause analysis: In the user table of the MySQL database, there is an account with an empty username, that is, an anonymous account. As a result, although the login is done as root, it is actually an anonymous login. Below is a comparison of the two login methods 1)mysql -u root -p It can be seen that this most primitive method is not safe, and the system does not know whether the user is anonymous. 2)mysql -hlocalhost -uroot -p -h represents the server name, localhost represents the local; -u represents the database user name, root is the default user name of MySQL; -p represents the password. If a password is set, you can directly enter it after -p, such as: -p123456. If the user has not set a password, just press Enter when Enter password is displayed. This method of entering the database can quickly resolve the problem. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: HTML+VUE paging to achieve cool IoT large screen function
>>: harborRestart operation after modifying the configuration file
Today, this article has collected 30 excellent cas...
Table of contents 1. Usage 1. Basic usage 2. The ...
Docker image download is stuck or too slow I sear...
Using the clear property to clear floats is a comm...
The a tag is mainly used to implement page jump, ...
Download MySQL https://dev.mysql.com/downloads/my...
The hyperlink <a> tag represents a link poin...
Maybe everyone knows that js execution will block...
Remove the dotted box on the link Copy code The co...
I have recently been following the CSS Animation ...
Table of contents What is async? Why do we need a...
Environment Preparation Docker environment MySQL ...
background Flex layout achieves alignment and spa...
FOUC is Flash of Unstyled Content, abbreviated as ...
Mainly from two aspects: 1. Highlight/Line Break ...