Last answered:

26 Oct 2024

Posted on:

20 Oct 2024

0

Resolved: MySQL set up a connection not working?

I have been having issues with trying to set a new connection on MySQL. I continue to get two errors: "Cannot Connect to Database Server", and "Failed to Connect to MySQL at 127.0.0.1:3306 with user "(username I typed)". I have downloaded the most current MySQL Server 8.0.40 as well as the MySQL Workbench.
I have been working on this for around 12 hours today (taking breaks). I want to solve this issue. 
Please see my screenshots attached of the issues I am having, and me trying to solve, hopefully you can see them.
Thank you,
Tara G.
6 answers ( 1 marked as helpful)
Instructor
Posted on:

22 Oct 2024

0
Hi Tara!

Thanks for reaching out.

Thank you for providing multiple screenshots. 
There are several potential reasons for encountering an error in this situation. Can you please answer the following questions, so that we can assist you better?
1. Please ensure you are referring to the correct connection (nativeuser in your case). Please note that you are not obliged to use this one, you can stick to using root
2. Please ensure you have typed the correct password. If you are using several keyboards, please ensure you are typing the password using the correct one.
3. Verify the localhost and the port are the same number as expected (something we cannot deduct from the Manage Server Connections window from the screenshot you have provided. 
4. Ensure port 3036 is not blocked from your Firewall.
5. If none of these works, consider reinstalling Workbench (and if it doesn't work, consider downgrading (i.e. installing an archived, slightly older version).
To do that, please follow the step-wise approach explained here:
Solving this issue might take several steps, but please try to implement every step we suggest and report back with screenshots. Thus, we are supposed to get Workbench working for you.

Hope this helps but please feel free to get back to us should you need further assistance. Thank you.
Best,
Martin
Posted on:

23 Oct 2024

0
Hello, Martin G.,
Thank you for your suggestions. However, this is not working for me.
I have turned off the Firewall and uninstalled then installed MySQL Server and Workbench again. I see that even on the web browser I get an error for typing localhost, or 127.0.0.1.  Please see my screenshots:
 
Instructor
Posted on:

23 Oct 2024

0
Hi Tara!
Thanks for your prompt reply.
1) I don't think you need to use the prompt to set up the connection.
2) In the screenshot you sent me, your Firewall is on. Try switching it off when setting up the connection.
3) Regarding uninstallation - you do need to go through all 4 steps mentioned in the link provided. Otherwise Workbench gets stuck on a port issue and no matter how many times you try installing it afterward, you might not manage to run the program.
If you successfully and fully uninstall the program, reboot your computer, and install it, it should work. 
Considering that you have already tried this several times, I suggest after rebooting, you install an archived version, 5.17 for instance. It will suffice for completing the SQL course.
Hope this helps but please feel free to get back to us should you need further assistance. Thank you.
Best,
Martin
Posted on:

23 Oct 2024

0
Hello, Martin,
It works now! I didn't have to do the Command Prompt to get a new connection at all. So, what worked for me is:
1) Deleted all MySQL programs as well as the folder on my laptop. 
2) Restarted my laptop.
3)Turned off all Firewalls.
4) Downloaded the most current MySQL Installer 8.0 version again because it wouldn't let me download the 5.7.44 version. 
5) When it was ready to allow me to install the MySQL Server and Workbench, I chose a previous version in the drop-down list such as 8.0.15 version for both.
6) I did get errors for trying to download for things back-to-back on the MySQL Installer. So, I had to backup/previous page in the window and try those same downloads again. Which they successfully downloaded.
7) Once all were downloaded successfully, I noticed MySQL Workbench appeared on its own. 
8) I had clicked on the Local Connection and the password box appeared. 
9) I typed in the password I had used, and clicked OK. 
10) Successfully, MySQL Workbench opened for me.
Question: do I have to keep my Firewalls turned off while I use MySQL Server and Workbench? Or can I turn them back on?
Thank you so much for your help!
Tara G.
Instructor
Posted on:

24 Oct 2024

0
Hi Tara!
Thanks for reaching out.

You don’t need to keep your Firewalls turned off permanently. You can turn them back on, but you might need to create exceptions for MySQL Server and Workbench. Here's how:

1) Turn your Firewalls back on.
2) Add MySQL to the firewall exceptions: Go to your Firewall settings and allow MySQL Server (TCP port 3306 by default) and MySQL Workbench through the Firewall. This will ensure that they can still communicate without interruption.
Feel free to turn the Firewall on, and just ensure the proper exceptions are set!

Hope this helps.
Best,
Tsvetelin
Posted on:

26 Oct 2024

0
Thank you, Tsvetelin.
I will try this suggestion before I start practicing and refresh on MySQL. 
Thank you, 
Tara G.

Submit an answer