'mysqldump' is not recognized as an internal or external command
Asked Answered
C

7

19

currently im trying to make backup and restore mysql database in my laravel project. I am using this laravel package https://github.com/backup-manager/laravel for backup package. i already follow the intructions, but when i am trying to backup my local database through command line (php artisan db:backup) in the last question, i got this message.

Dumping database and uploading...   

[BackupManager\ShellProcessing\ShellProcessFailed]
'mysqldump' is not recognized as an internal or external command,
operable program or batch file.

I already googling it, and already put C:\xampp\mysql\bin to my windows env variables paths, but i still having this issue. if anybody know how to fix this, please tell me, i really appreciate it.

Laravel 5.1.x

Carbonize answered 11/7, 2015 at 7:14 Comment(7)
Open a new command window. Type set. Look at path. Was it updated? Type mysqldumpOverall
Yes, it is updated, But, when i type mysqldump, i got the same message. ('mysqldump' is not recognized as an internal or external command, operable program or batch file.)Carbonize
Cd c:\ then dir mysqldump.exe /sOverall
The system cannot find the path specified.Carbonize
These guys have it https://mcmap.net/q/666095/-dump-matching-tables-phpOverall
Looks like you haven't installed mysqldumpBedel
I thought xampp already have mysqldump in itCarbonize
P
26

It is because mysqldump.exe is not found in that location, the right path is given bellow

  1. Open Command Prompt and type this

    cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin

Press Enter

then type

mysqldump.exe

or,

Directly open this directory "C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin" and Press LEFT SHIFT KEY from keyboard and RIGHT CLICK on the Directory Window. then type

mysqldump.exe

It will work 100% correctly

Palatable answered 29/11, 2016 at 19:13 Comment(1)
saved me a lot of time!Brainard
O
10

If you are using Xamp then:

  1. Open your Xamp folder
  2. Go to \mysql\bin find the mysqldump.exe
  3. Go to your environment variables under System variable click on 'New'.
  4. As 'variable name' put 'mysqldump'(without the quotes) and as 'variable value' put the path to your xamp\mysql\bin\mysqldump.exe this will make 'mysqldump' available as a global system alias.

Reminder: Make sure to restart your command-line interface.

Oe answered 21/10, 2020 at 8:17 Comment(2)
For Windwos 10: Control Panel\System and Security\System > Advanced system settings > Environment Variables (from Nick's comment to answer https://mcmap.net/q/341982/-how-to-access-the-command-line-for-xampp-on-windows)Xena
In my case, I had to edit System Variables -> Path, then add it. If you just add it to System Variables, it might not work.Fire
N
2

On my side, I was using PowerShell and I had the same error message. I had to go inside the directory of MySql. Mine was located in:

C:\Program Files\MySQL\MySQL Server 5.7\bin

Then I had to make sure that I had mysqldump.exe in the bin folder. enter image description here

And then run this command:

 ./mysqldump.exe -u root -p yordbName > C:\MySqlDump\sakila.sql

enter image description here

Nork answered 30/3, 2021 at 18:4 Comment(0)
G
1

It happened with me and I solved it by adding the following line at the top of the .bat file.

cd "C:\xampp\mysql\bin"

Grenoble answered 11/5, 2022 at 6:52 Comment(1)
OP is not using a windows batch file but PHP/Laravel.Haffner
A
1

Please add C:\xampp\mysql\bin to this path at your user variables and system variables. If you are using a wamp server, add C:\wamp64\bin\mysql\mysql8.0.27\bin this path at your user and system variables.

Note: MySQL version path will change as per your installation.

Anallise answered 25/5, 2022 at 7:16 Comment(0)
S
0

It is late, but I will answer to this question for other people who have the same issue.

You need to add the mysqldump.exe runtime file path to your Windows environment variable. I am using Wamp, the path look like this "C:\wamp64\bin\mysql\mysqlx.x.xx\bin"

Close your command-line interface and try again, It should work.

Spanish answered 28/3, 2022 at 18:51 Comment(0)
D
-1

I am using Xamp and the following step is working:

Copy the path "C:\xampp\mysql\bin" Go to your environment variables under System variable click on 'Path' and add "New". Put the path there then click ok. Restart your command-line interface.

Disconcert answered 22/11, 2021 at 23:9 Comment(1)
OP explicity stated that he has already tried this.Haffner

© 2022 - 2024 — McMap. All rights reserved.