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
MySQL will automatically create a database named ...
This article uses an example to illustrate the us...
UPD 2020.2.26 Currently Ubuntu 20.04 LTS has not ...
Recently, I need to implement a cascading selecti...
There are many tags and elements in the HTML head ...
Preface I recently encountered this requirement a...
This article shares the specific code for the WeC...
Preface Before starting this article, let’s do a ...
Project Scenario Add a custom watermark to the en...
1. Background When the Docker service is started,...
I was working on a pop-up ad recently. Since the d...
Preface There are many open source monitoring too...
Carousel The main idea is: In the large container...
In the migration of Oracle database to MySQL data...
Table of contents Lazy Loading CSS styles: HTML p...