Problem connecting to mysql database with mysql workbench
Hi I posted this on mysql forums but nobody replied so I wonder if someone could help me here? I am new to mysql and I want to learn some code. I installed mysql community workbench on linux mint victoria with snapd and then I installed mysql client and server with the software centre. I can see a database in mysql workbench : Local instance 3306 : root : localhost:3306. When I click on it I get the following message:
Your connection attempt failed for user 'root' to the Mysql server at localhost:3306: Access denied for user 'root'@'localhost' Please: 1 Check that Mysql is running on address localhost 2 Check that Mysql is reachable on port 3306(note: 3306 is the default, but this can be changed) 3 Check the user root has rights to connect to localhost from your address(Mysql rights define what clients can connect to the server and from which machines) 4 Make sure you are both providing a password if needed and using the correct password for localhost connecting from the host address you are connecting from Can someone show me how to carry out these checks so I can connect to the database and practice some code? Thanks. |
Quote:
MySQL is just another Linux service. Try running "sudo systemctl status mysql.service" and see if it's running. Did you actually modify the MySQL config to change the port?? If not, then it's still using 3306. And root should (by default) have access to things (again, unless you've changed things). |
Which distribution of Linux are you using and which version?
I would suggest running mysql_secure_installation explained at the link below. Did you use a password when trying to access mysql? Did you create a password for root in mysql? https://dev.mysql.com/doc/refman/8.0...tallation.html |
See if the process is running:
Code:
ss -l -p -n | grep mysql Code:
mysql |
Problem logging in
when I try to log in in the terminal with mysql -u root -p
I get ERROR 1698 (28000): Access denied for user 'root'@'localhost' how do I correct that please? |
I would guess that you never set a password or changed the authentication method for root.
https://phoenixnap.com/kb/access-den...root-localhost |
Quote:
Did you check the service to see if it's running??? Did you change anything?? Did you try the command given to you by jaywa? Did you try to look up the exact message you got, that michaelk gave you a link for??? |
Quote:
Code:
mysql -uroot -pWhateverYouFound |
I tried this and I think its working now.
Thanks for all your help! :-) https://www.databasestar.com/access-...-at-localhost/ |
If you had run mysql_secure_installation as suggested above, this would all have been taken care of as you are then asked to create a root password for mysql if you don't have one.
|
All times are GMT -5. The time now is 02:27 AM. |