Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problems connecting to port 3306 mysql workbench with XAMPP

Tags:

mysql

port

xampp

I'm trying to learn the apache / mysql / php stack bundled with XAMPP. I can't connect to the MySQL server using the MySQL workbench:

Your connection attempt failed for user 'root' from your host to server at localhost:3306: Can't connect to MySQL server on '127.0.0.1' (61)

Thinking it's a port problem, I check the port directly in Terminal with the command telnet 3306:

telnet: connect to address 127.0.0.1: Connection refused

Obviously the problem isn't with the Workbench, but something to do with the port connection itself.

I'm using:

  • OS 10.8 Mountain Lion
  • XAMPP 1.7.3
  • MySQL workbench 5.2.47
like image 291
Andrew Avatar asked May 16 '13 07:05

Andrew


People also ask

How do I fix MySQL port in XAMPP?

The good news is that, if this does happen, there are three methods you can use to troubleshoot the issue: Run XAMPP using administrator privileges. Restore your database backup. Change your MySQL port.

Can I connect MySQL Workbench to XAMPP?

Open up a new connection on Workbench and set Connection Name: [choose a name] Connection Method: Standard (TCP/IP) In the parameters tab: Hostname: localhost Port: 3306 Username: root Password: leave blank Click ok and you should now be connected.

Why MySQL is not working in XAMPP?

Fixing the MySQL server not starting in XAMPP is done by reverting back the data files pre-issue. Navigate to your XAMPP MySQL directory ( C:\xampp\mysql ). Create a new folder called FIX_BACKUP . Copy C:\xampp\mysql\backup and C:\xampp\mysql\data into C:\xampp\mysql\FIX_BACKUP .

Why MySQL Workbench is not connecting?

Please: Check that MySQL is running on address localhost. Check that MySQL is reachable on port 3306 (note: 3306 is the default, but this can be changed). 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).


3 Answers

Sorry all, I'm posting my own question and answer. I had this problem and it nearly destroyed me because I could not find the correct answer anywhere on the interwebz. I finally overcame it, and wanted to post my findings in case it helps another befuddled traveler.

It turns out when you install XAMPP and choose to run the security routines, it automatically turns on a setting in the MySQL preferences to block connections on port 3306 from localhost. To fix this, open my.cnf in the xampp folder xamppfiles/etc. Look for the setting "skip-networking" which tells mySQL to block the port 3306. Comment this out by adding a pound sign so it is "#skip-networking". Now, the telnet command should work, and you should be able to use the Workbench.

Hope this is helpful for somebody!If it fixes your problem, give me a shout at @mrcheeks3185.

like image 155
Andrew Avatar answered Oct 20 '22 18:10

Andrew


I faced same problem but I solved it.

I changed the MySQL workbench port to 3307 in the file below

C:\ProgramData\MySQL\MySQL Server 5.7\my.ini

and keep the default port 3306 for XAMPP

like image 32
Mohammad Esmail Avatar answered Oct 20 '22 18:10

Mohammad Esmail


for mac you should create only a user with password and grant access(in my case a I use root with password) and turn on ip address and use that address to connect with a client like navcat or workbench I use XAMPP 7.3

ip address network given by XAMPP

connection config in navcat

test connection

like image 21
Raphael Torres Balderas Avatar answered Oct 20 '22 16:10

Raphael Torres Balderas