skip to Main Content

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


  1. 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 or localhost. You need to create root@‘%' user.

    Login or Signup to reply.
  2. the error is that MySqlWorkbench is trying to connect with admin user not root user, are you sure the admin user already exist?
    you can try to connect with root user from MysqlWorkbench or create the admin user
    CREATE USER 'admin'@'%' IDENTIFIED BY 'PASSWORD_HERE';

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search