snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

SnipeIT Restore failed with Error Error mysql tool at: 'C:\\PROGRA~1\\MARIAD~1.0\\bin/mysql' does not exist, cannot restore

Open upadhyayajay5 opened this issue 2 years ago • 9 comments

Debug mode

Describe the bug

When i am trying to restore the backup from Web gui or with command line, It's failed with error. Error mysql tool at: 'C:\PROGRA~1\MARIAD~1.0\bin/mysql' does not exist, cannot restore.. Please edit DB_DUMP_PATH in your .env to point to a directory that contains the mysqldump and mysql binary i have also checked the .env file and db dump path is configured like below. DB_DUMP_PATH='C:\PROGRA~1\MARIAD~1.0\bin' image

Reproduction steps

1.Created the backup and trying to restore it- 2. 3. ...

Expected behavior

this is added feaure in 6.0 and not working

Screenshots

image

Snipe-IT Version

v6.0.0-RC-1 - build 6592

Operating System

Windows

Web Server

IIS

PHP Version

7.4.27

Operating System

Windows

Browser

Chrome

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

upadhyayajay5 avatar Feb 08 '22 15:02 upadhyayajay5

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

welcome[bot] avatar Feb 08 '22 15:02 welcome[bot]

Per the docs, what’s the output of cmd /c for %A in ("C:\Program Files\MariaDB 10.1\bin") do @echo %~sA run via cli?

snipe avatar Feb 08 '22 15:02 snipe

image

This is the output from the command line, dually checked with single quotes and double quotes, also tried with users root.

upadhyayajay5 avatar Feb 09 '22 08:02 upadhyayajay5

i ran procmon and found that mysql file was missing. i have just copied the mysql.exe to mysql and tried to restored which worked. @snipe image

upadhyayajay5 avatar Feb 09 '22 12:02 upadhyayajay5

image

upadhyayajay5 avatar Feb 09 '22 12:02 upadhyayajay5

I just came across this issue as well. On Windows, the mysql binary is at DB_DUMP_PATH\mysql.exe but the code is looking for /mysql.

https://github.com/snipe/snipe-it/blob/d7d0056b736b17455463322eaf685a76a7fa9598/app/Console/Commands/RestoreFromBackup.php#L217

drewbino-rcg avatar Jul 28 '22 15:07 drewbino-rcg

As we mention in the docs, that dump path should point to the directory, not the binary. 1D56ADE6-6EA4-48BE-A68E-335E1FDAC2B8

snipe avatar Jul 28 '22 15:07 snipe

I have correctly configured the dump path to point to the directory, but the line of code I referenced is looking for the binary as mysql instead of how it is on Windows: mysql.exe

https://github.com/snipe/snipe-it/blob/d7d0056b736b17455463322eaf685a76a7fa9598/app/Console/Commands/RestoreFromBackup.php#L217

If I change that line in my local copy of RestoreFromBackup.php to the following, it works:

$mysql_binary = config('database.connections.mysql.dump.dump_binary_path').'\mysql.exe'; 

drewbino-rcg avatar Jul 28 '22 16:07 drewbino-rcg

Facing the same issue by restoring the GUI or CMD. but completed my work with the help of MYSQL Workbench. copy all the data from the backup file and pasted it.

ghost avatar Sep 19 '22 13:09 ghost

Facing the same issue by restoring the GUI or CMD. but completed my work with the help of MYSQL Workbench. copy all the data from the backup file and pasted it.

Hello, I am a newbie and am trying to set up MYSQL workbench with no luck. The snipe-it is on a different server (192.168.100.20) and MySQL workbench is on another ip (192.168.100.4). Of course the firewall is turned off, DB_HOST=0.0.0.0

I would be grateful

luckyelms avatar Mar 13 '24 01:03 luckyelms