Can't get mysqldump to connect to local mysql instance (error 2003 / 10061)
Asked Answered
C

3

7

I've got mysql 5.1 on a windows xp machine. It's listening on port 3308. I'm trying to use mysqldump:

> mysqldump -u root -pmypassword dbname > out.sql

Getting an error:

mysqldump: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) when trying to connect

Not sure what the problem is, looking at --help dumps variables and shows port=3308 as I set in the mysql installation (instead of default 3306). I don't think there's anything different with my installation. I also tried explicitly setting the port # on the command line but still same error.

Thanks

Coper answered 24/3, 2011 at 23:31 Comment(5)
simple test: try telnet 127.0.0.1 3308. Does it respond with a version number?Prong
Have you tried > mysqldump -u root -pmypassword -P 3308 dbname > out.sql ?Prong
Run mysqladmin -u root -pmypassword variables and check that skip-networking is FALSE.Prong
using the -P version worked (I was using --port). Thank you all.Coper
@ypercube post this as an answer so that it can be accepted and easier to see in future ;)Ashjian
C
11

To connect through a port (and not the default 3306), use:

mysqldump -u root -pmypassword -P 3308 dbname > out.sql

Besides that, a simple test to see if MySQL responds at port 3308 is to try telneting:

telnet 127.0.0.1 3308

If MySQL is listening on port 3308, it'll respond with an error and the version running.

Chrysotile answered 25/3, 2011 at 14:28 Comment(1)
For a very large sql file this may help you mysqldump --set-gtid-purged=OFFHerriott
J
1

Go to run type services.msc

then locate mysql service and start it .this solved

Jato answered 13/6, 2013 at 7:6 Comment(1)
Yes. Its startup type is Automatic but it wasn't running.Barbette
J
0

If your Mysql-Client is 5.5.16 please upgrade it to 5.6.10, this process worked for me if your mysql server is 5.6.10.

Jankell answered 19/3, 2013 at 11:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.