Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincej's avatar
Level 15

PHPStorm wants path to mysqldump on Homestead - where is it?

PHPStorm has an excellent DB editor. I need to dump my database using mysqldump however the path to mysqldump is required by Storm. I am on Homestead.

Any ideas where or how I might find that path?

Many Thanks !

0 likes
13 replies
jlrdw's avatar

Usually under mysql bin directory.

vincej's avatar
Level 15

Dumb question, I am currently here, vagrant@homestead:~$

It's not obvious to me how to get into the core Ubuntu file system. Advice?

Thanks!

siangboon's avatar

in sql editor, try

SHOW VARIABLES WHERE variable_name LIKE "%dir"
vincej's avatar
Level 15

Yup, I have Mysql inside Homestead. I can connect with Storm and I can edit the tables and database. However, I need to do a backup, which in Storm means using MySqldump. In the empty dialogue box for backup I get an error path to MySql Dump is Wrong.

I saw that SO post yesterday, so I tried using the CLI yesterday, and again today with

vagrant@homestead:~$ mysqldump -u homestead -p contraxiq > C:\Users\vince\Documents\dumps\extradump.sql;

It executes without error, but I get nothing in the target folder.

Maybe I should not be inside vagrant@homestead. Maybe I should be inside Mysql> but when I try that I get all these errors:

mysql> dump -u homestead -p contraxiq > C:\Users\vince\Documents\dumps\extradump.sql;
ERROR:
Unknown command '\U'.
ERROR:
Unknown command '\v'.
ERROR:
Unknown command '\D'.
    ->

Eventually I will get the database out, one way or another, even if that means somehow I have to install PHPMyAdmin or MYSQL WorkBench. I just like to see my tools working properly. And it bugs me when they don't.

Thanks for all your help !

jlrdw's avatar

@vincej bin folder:

mysql\bin> mysqldump -u homestead -p contraxiq > C:\Users\vince\Documents\dumps\extradump.sql;

Here is one I use, not homestead:

c:
cd\
cd "C:\xampp\mysql\bin"

mysqldump -uroot -pzzzzzzz --add-drop-database --databases --routines laravel58 > "C:\zipfold\mysql_backs\xbacks\laravel58.sql"
vincej's avatar
Level 15

I ran this as suggested, and got the same errors. How about I destroy my vagrant box and start again?

mysql> mysql\bin> mysqldump -u homestead -p contraxiq > C:\Users\vince\Documents\dumps\extradump.sql;
ERROR:
Unknown command '\b'.
ERROR:
Unknown command '\U'.
ERROR:
Unknown command '\v'.
ERROR:
Unknown command '\D'.

vincej's avatar
Level 15

sorry, stupid me.

Ok, I'm struggling to find the mysql/bin folder you refer to. Remember, as I am on Homestead, I am searching through Ubuntu. Your back slashes suggest you are on Windows. This is what I found - no `/bin' folder:

vagrant@homestead:/etc/mysql$ ls
conf.d  debian.cnf  debian-start  my.cnf  my.cnf.fallback  mysql.cnf  mysql.conf.d

So - any suggestions where this bin folder is hiding in Ubuntu? I have looked inside opt, bin, etc

vincej's avatar
Level 15

Also help me with this. If I destroy my vagrant box and then rebuild it do I lose my database all the data all my files everything? Or is there some magical way that these things are maintained

jlrdw's avatar

There should be a shared folder for the virtual machine and host operating system. I would back up the data first. Homestead should have that mysqldump command. If not there is a way to install it, but I cannot seem to find that article now.

vincej's avatar
Level 15

OK, thanks for that. I kind of seem stuck. I need to back up my data in order to destroy my data however I cannot back up my data because well my SQL dump doesn’t seem to want to work so I think what I will resort to is getting my SQL workbench out and attempt to back up my data that way then I will back up my files and then I’m going to destroy my vagrant box and rebuild it.

You are a rockstar thanks for all your help!

vincej's avatar
Level 15

Ok, It looks like I am close to solving my problem. So I have created a server within Laragon on my Windows laptop. Then, I found the location of the mysqldump.exe within Laragon so I can now also run Storm on the laptop.

Additionally, I have managed to get the data off of Homestead. I will now delete Homestead off of my Windows laptop where I only do 20% of my work in the evenings. I do 80% of my work on a 3 screen Linux server in my office. I still have a snag with Windows permissions for the dump, but I'll get past that one way or another.

Thank you again with all your recommendations and efforts. I always can rely on you to come to the rescue! I hope you have a Merry Christmas despite covid. Cheers !!

1 like

Please or to participate in this conversation.