I’m learning SQL via MySQL, and wanted to play around MySQL connections, in order to learn that concept. I deleted all existing ones, and tried creating a new one with the following settings:
enter image description here
But, when I click on it, I get the following error:
"Your connection attempt failed for user ‘admin’ to the MySQL server at 127.0.0.1:3306". Access Denied for user ‘admin’@’localhost’ (using password: NO)"
enter image description here
I tried to change Connection Method to "Local Socket/Pipe" and still got the same error.
I also tried this terminal command mysql -u root -p -h 127.0.0.1 -P 3306
with no results.
enter image description here
Any suggestions?
Update:
I created a new connection with root
as username and TCP/IP
as a connection method. I successfully connected using a password I set upon installation. How is this possible when I created new connection from scratch?
2
Answers
Need to set a password, you can click clean first, and then enter the password to test whether the connection is available. In addition, it is recommended to use a specific ip address instead of
127.0.0.1
orlocalhost
. You need to createroot@‘%'
user.the error is that MySqlWorkbench is trying to connect with
admin
user notroot
user, are you sure the admin user already exist?you can try to connect with root user from MysqlWorkbench or create the
admin
userCREATE USER 'admin'@'%' IDENTIFIED BY 'PASSWORD_HERE';