Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'mysqldump' is not recognized as an internal or external command

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

like image 801
RK26 Avatar asked Jul 11 '15 07:07

RK26


People also ask

Why are the Mysqldump is not recognized?

Go to \mysql\bin find the mysqldump.exe. Go to your environment variables under System variable click on 'New'. 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.

How do I run Mysqldump on Windows?

To dump/export a MySQL database, execute the following command in the Windows command prompt: mysqldump -u username -p dbname > filename. sql . After entering that command you will be prompted for your password.

What is Mysqldump command?

It dumps one or more MySQL databases for backup or transfer to another SQL server. The mysqldump command can also generate output in CSV, other delimited text, or XML format.


2 Answers

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

like image 60
Bhaskar Mohanta Avatar answered Sep 16 '22 14:09

Bhaskar Mohanta


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.

like image 42
Mocktar Issa Avatar answered Sep 18 '22 14:09

Mocktar Issa