Last answered:

07 Apr 2020

Posted on:

05 Apr 2020

0

Cannot Connect to Database Server

Hello, I Installed MySQL, but systeme write that cannot to database server: your connection attempt failed for user 'root' to the MySQL server at localhost3306. access denied for uoser 'root@localhost'(using password:YES I think I wrote incorrecte password when installed  MySQL ( I wrote: 365pass, but correct 365Pass) How I can connect to Database Server? Could you please help me Thank you advance, Natalia
1 answers ( 0 marked as helpful)
Instructor
Posted on:

07 Apr 2020

0
Hi Natalia! Thanks for reaching out. As a general note, please remember that knowing your password for your MySQL database is perhaps more important than for other tools you are using, because of security reasons. You basically have two options.  The first one, and if executed successfully, it'd definitely solve the problem, is removing MySQL from your computer completely.  To do this, if you are a Windows user, for instance, please do remove all traces from MySQL from the following 4 "places" (and don't miss checking any of these, as this might be the problem while retrying to install MySQL later): 1 - from Control Panel 2 - Firewall 3 - the windows registry 4 - any folders or files remaining in %programdata%. Then, install MySQL again in the well-known way, this time not forgetting your password. Alternatively, you can try to reset your password, in one of the following two ways, depending on whether you are a Windows or Mac user. For Windows users:
Basically, if you need to reset your password, it’s best to read through Section B.4.3.2.1 from the following link:
https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
There, you will find a seven-step process provided by the creators of the software, so it is as good as it can be.
Remember that if you find it too complicated or there's something that doesn't work as indicated in the steps, you could uninstall MySQL completely, and install it again, this time remembering your password. For Mac users:
Execute the following commands:
  1. to stop the server if it is running:
sudo /usr/local/mysql/support-files/mysql.server stop
 2) to start the server in safe mode:
sudo mysqld_safe --skip-grant-tables 
Then, open a new terminal and try the following commands. 3)  to log in without a password:
mysql -u root
4) to update the user’s password:
FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '<YourNewPass>';
and 5) to start the server.
sudo /usr/local/mysql/support-files/mysql.server start
Hope this helps.
Best,
Martin

Submit an answer