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
This article shares the specific code of JavaScri...
Table of contents Preface 1. Nginx installation 1...
Vue front and back end ports are inconsistent In ...
Three ways to set borders in HTML border-width: 1...
Table of contents 8. CSS3 click button circular p...
Table of contents introduce Object attributes in ...
Use ktl tool to synchronize data from mysql to my...
This article shares with you the MySQL 8.0.13 ins...
Virtualization and containerization are two inevi...
1. Install mysql Run the following command to upd...
Table of contents Workaround Why can't I moni...
Table of contents Preface What is VueUse Easy to ...
question In LINUX, periodic tasks are usually han...
This article shares with you how to use the Vue c...
Today I was dealing with the issue of migrating a...