Tuesday, April 7, 2020

Answer for Cannot Connect to Database Server

https://365datascience.com/dwqa-answer/answer-for-cannot-connect-to-database-server/ -

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




#365datascience #DataScience #data #science #365datascience #BigData #tutorial #infographic #career #salary #education #howto #scientist #engineer #course #engineer #MachineLearning #machine #learning #certificate #udemy

No comments:

Post a Comment