Page 1 of 2

Issue with the database backup on the new version

Posted: 2018-01-23 17:53
by nycwebmaster
Hi,

Just downloaded the new version 5.70 revision 1020 and is giving the following error when trying to do a backup of the database:

'mysqldump' is not recognized as an internal or external command,
operable program or batch file.

Re: Issue with the database backup on the new version

Posted: 2018-01-23 22:01
by a.gneady
If you're running your generated application on Windows, you need to include mysqldump's folder in the PATH environment variable in order for backup to be able to find it. Here is how to edit the PATH variable in Windows:
  1. Start the System Control Panel applet (Start - Settings - Control Panel - System).
  2. Select the Advanced tab.
  3. Click the Environment Variables button.
  4. Under System Variables, select Path, then click Edit.
  5. You'll see a list of folders, something like this:

    Code: Select all

    C:\Program Files\Windows Resource Kits\Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Support Tools\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common Files\Ulead Systems\MPEG;
  6. You can add additional folders that you want to include in searches. For example C:\xampp\mysql\bin. Click OK.
  7. You'll need to sign out of Windows and sign in again for the changes to take effect.
If the application is running on Linux, check this page for how to add mysqldump to the PATH: https://unix.stackexchange.com/question ... th-to-path

Re: Issue with the database backup on the new version

Posted: 2018-01-24 00:51
by baudwalker
still have issues.

after following your instruction and inserting the parth - C:\wamp64\bin\mysql\mysql5.7.19\bin all semed to work, but it hangs and hold the application in maintanance mode.

when I close the project down and delete the .maintenance file I have an empty file in the backup folder that I cant remove.

see attached

Re: Issue with the database backup on the new version

Posted: 2018-01-24 01:24
by baudwalker
it seems that mysqldump.exe is hanging. If I do a forced stop all returns back to normal, but no backup completed and I can delete the backup files.It still hangs if I attempt another backup

Re: Issue with the database backup on the new version

Posted: 2018-01-24 03:51
by baudwalker
I uploaded a small test project to my hosted server and attempted a backup and got the following error.

mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)

then it seamed to work but restored nothing capture of sql file attached

Re: Issue with the database backup on the new version

Posted: 2018-01-26 00:06
by baudwalker
any result?

Re: Issue with the database backup on the new version

Posted: 2018-01-26 23:07
by a.gneady
Seems to me like the version of mysqldump installed on your server is not compatible with the version of MySQL installed. Your server admin might need to update installed MySQL. The issue is discussed in an old thread on mysql.com here: https://bugs.mysql.com/bug.php?id=66765

Re: Issue with the database backup on the new version

Posted: 2018-01-29 06:59
by baudwalker
I am waiting on a reply from my hosting service, weekend and all that.

On my windows 10 local host I completed the System Variables alteration and mentioned above and no longer get "'mysqldump' is not recognized as an internal or external command,operable program or batch file." error. But The Please wait button just sits there and that's all. it will remain like that as long as I allow. If I close the windows .maintenance file is not deleted and the mysqldump.exe hangs. requiring me to open task manager and stop mysqldump.exe then remove the .maintenance file.

Help please

Re: Issue with the database backup on the new version

Posted: 2018-01-30 02:49
by baudwalker
Updating my hosted service php to 5.6 FPM worked a treat.

just working on the localhost to get that working properly

Re: Issue with the database backup on the new version

Posted: 2018-01-30 08:17
by a.gneady
baudwalker wrote:
2018-01-29 06:59
But The Please wait button just sits there and that's all. it will remain like that as long as I allow.
Mmm .. Before clicking the 'create backup' button, please press F12 to open the inspector, then go to the Network tab > XHR sub-tab. Then start the backup and see if any error is reported in the XHR tab.

Re: Issue with the database backup on the new version

Posted: 2018-01-31 06:51
by baudwalker
No error from the XHR tab but there are other errors... see attached

Re: Issue with the database backup on the new version

Posted: 2018-01-31 09:45
by a.gneady
The error reported in the console is irrelevant to this issue and should cause no trouble in the page. It's the request below it that matters (the request to pageBackupRestore.php?action=create_backup) ... it shows as (Pending) in the screenshot ... so I guess something goes wrong when trying to execute the mysqldump command ...

Could you try running it manually form the command line and see what happens? To do so, open a command prompt (Start menu > type "cmd" and press Enter) then type the following in the command window:

Code: Select all

mysqldump -u{username} -p{password} -N {dbname} > test.sql
Replace {username}, {password} and {dbname} with the names of your MySQL uer, password and database name.

Re: Issue with the database backup on the new version

Posted: 2018-02-01 04:25
by baudwalker
yes that worked...

C:\Users\barry>mysqldump -u root -p -N test_6-7 > test.sql
Enter password:
C:\Users\barry>

this is a test DB with user of root and no PW . when it asked I hit enter and the test.sql was created

Re: Issue with the database backup on the new version

Posted: 2018-02-04 20:37
by a.gneady
this is a test DB with user of root and no PW
Aha .. I guess this is the cause of the issue .. Having no database password causes the command executed by the backup page to prompt for a password and since there is no one to hit Enter at that moment, the backup request will keep waiting forever. The temporary fix for this issue for now is to define a password for 'root' ... We'll make a fix for this issue in AppGini 5.71.

Re: Issue with the database backup on the new version

Posted: 2018-02-05 03:16
by baudwalker
That was the Problem,

I only use localhost for testing my work. So I made a new user with full privileges, deleted the web files and reinstall the application using the new user and pass. The backup and restore worked.

Don't break out the champagne just yet. I got this warning with the backup..."mysqldump: [Warning] Using a password on the command line interface can be insecure."

Re: Issue with the database backup on the new version

Posted: 2018-02-11 10:41
by a.gneady
You could ignore this warning. mysqldump either prompts the user for a password, or should have one provided through the command line. The first option is the preferred one but is not possible to automate, while the second option is the one that can be automated.

Re: Issue with the database backup on the new version

Posted: 2019-06-07 01:47
by dharbitindy
a.gneady wrote:
2018-02-04 20:37
this is a test DB with user of root and no PW
Aha .. I guess this is the cause of the issue .. Having no database password causes the command executed by the backup page to prompt for a password and since there is no one to hit Enter at that moment, the backup request will keep waiting forever. The temporary fix for this issue for now is to define a password for 'root' ... We'll make a fix for this issue in AppGini 5.71.
How do you create a password for the localhost root user? I am using the latest version of AppGini and have the same issue. I'm guessing because the default database creation requires a blank password without an option to change it that I can see.

Thank you,
David

Re: Issue with the database backup on the new version

Posted: 2019-06-13 13:18
by a.gneady
I'm guessing because the default database creation requires a blank password without an option to change it that I can see.
Try opening a command window (under Windows, open the Start menu and type 'cmd' and press Enter), then type this in the command line window:

Code: Select all

mysql -uroot
This would start MySQL shell. From there, type this:

Code: Select all

update user set authentication_string=PASSWORD("mynewpassword") where User='root';
flush privileges;
quit
Replace 'mynewpassword' above with the new root password you'd like to use.

Re: Issue with the database backup on the new version

Posted: 2020-12-28 15:21
by sacgtdev
I have added the C:/inetpub/wwwroot/admin/backups in environmental variable path. But, still can't generate backup. Why?

Code: Select all

(mysqldump --no-tablespaces -u"root" -p**** -h"localhost" "opdb" -r "C:/inetpub/wwwroot/admin"/backups/feff28c7b0dac26754eff9cca0a5c895.sql) 2>&1

'mysqldump' is not recognized as an internal or external command,
operable program or batch file.

Re: Issue with the database backup on the new version

Posted: 2021-06-05 09:41
by federico
a.gneady wrote:
2018-02-04 20:37
this is a test DB with user of root and no PW
Aha .. I guess this is the cause of the issue .. Having no database password causes the command executed by the backup page to prompt for a password and since there is no one to hit Enter at that moment, the backup request will keep waiting forever. The temporary fix for this issue for now is to define a password for 'root' ... We'll make a fix for this issue in AppGini 5.71.
Hi did you forget to fix it? ;) I have the same problem and it could be nice to make a backup from the app without going crazy with other solutions. thanks. PS I guess the back will include EVERYTHING

thanks
Federico

Re: Issue with the database backup on the new version

Posted: 2021-06-07 05:56
by jsetzer
I have added the C:/inetpub/wwwroot/admin/backups in environmental variable path
You have to set the directory name of mysqldump.exe, not your backups-directory.

In my case this is C:\xampp\mysql\bin but it may be different in your machine, depending on your database server installation.

As I was facing same problems, I have written a small "how-to" for Windows 10:
https://appgini.bizzworxx.de/appgini/so ... n-windows/

Re: Issue with the database backup on the new version

Posted: 2021-06-13 09:25
by federico
So I have a database password
I follow Jan tutorial, thanks a lot

but I have this problem:
(mysqldump --no-tablespaces -u"root" -p**** -h"localhost:3307" "TecnoApps" -r "D:/xampp/htdocs/TecnoApps/admin"/backups/6b07e624c80c3f15e.sql) 2>&1
mysqldump: Got error: 2005: "Unknown MySQL server host 'localhost:3307' (11001)" when trying to connect

I tried to change the Host file, but no result. How can i fix it?

Re: Issue with the database backup on the new version

Posted: 2021-06-14 07:42
by jsetzer
Unknown MySQL server host 'localhost:3307
Did your check if your local SQL server is running at all and listening on port 3307?

You can check it by downloading and using a tool like Adminer (https://www.adminer.org/) or any other database tool you prefer.

Re: Issue with the database backup on the new version

Posted: 2021-06-15 15:03
by federico
Hi Jan
yes of course. I use Xampp and MySQL is on the port 3307. Just checked again

Re: Issue with the database backup on the new version

Posted: 2021-06-15 15:11
by federico
i just tried Adminer and I opened the database. I'm inside but I don't know how to use it. I guess the port I use to open it, confirm that is correct