Hi all!

I have a big problem that I would like some help. I use Mysql Workbenc 5.2CE. I changed the default port to 3301. The mysql server is up and running well (I access it from an app I'm making with VB.NET). The problem is I can't get mysqldump to backup the database. I'm using the following code (in the command prompt)

"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe", "--user=root  --password =mypassword" "--host = 127.0.0.1 --port 3301 --databases MySQL databasename -r ""C:\GreatestHR Backup\BackUpDataBase.sql"""

(Note: I would like to use an IP Address for host)

When I run that, I get the error: "mysqldump: Got error: 2003: Can't connect to MySQL server on 'localhost' (10049)
when trying to connect ".

Can someone please help me on this? (People are not even talking about mysql's error 10049 online.)

I will appreciate any help.
Thanks.

10049 means address not available, it's a socket error. Port seems to be missing the equal sign, so check your syntax.

commented: thanks. please check my reply. +2

Try connecting to --host=localhost if you're using sockets..

commented: thanks. please check my reply. +2

Thank you all, but I haven't been able to solve the problem:
1. From dorco's suggestion: I followed the link and it says binding would be an issue only if I was connecting to another IP address, say a public IP or just any other. But, for my case, the server is on the same computer (localhost) so I presume the binding is set correctly.But thank you for the article, of course it will help me in the future since I'm going to do that.

2.Pritaes, thank you. I added the = to port but no success sir. I will post my code below.

3.Nickw, thank you. I did what you said (host=localhost) no success.

My code now looks like this:

    "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe", "--user=root --password =mypassword" "--host = localhost --port=3301 --databases MySQL databasename -r ""C:\GreatestHR Backup\BackUpDataBase.sql"""

But now I get a different error message:"Mysqldump: Got error:1044:Access denied for user ''@'localhost' to database ',' when selecting the database. (this is exactly how the error msg says, I didn't remove a thing in the '')

Please, I will appreciate more help.

Try this:

"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --user=root --password=mypassword --host=localhost --port=3301 --databases databasename > "C:\GreatestHR Backup\BackUpDataBase.sql"

Read more in the manual.

Pritaeas, I can't be more more thankful! It worked. I just see removing the "" made it work.

Thank you much, and thank you too for the link to the manual, I will study it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.