Issue with the database backup on the new version

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
nycwebmaster
Posts: 29
Joined: 2015-11-23 01:02

Issue with the database backup on the new version

Post by nycwebmaster » 2018-01-23 17:53

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.

User avatar
a.gneady
Site Admin
Posts: 923
Joined: 2012-09-27 14:46
Contact:

Re: Issue with the database backup on the new version

Post by a.gneady » 2018-01-23 22:01

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
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-01-24 00:51

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
Attachments
appgini error.PNG
appgini error.PNG (21.06 KiB) Viewed 3580 times

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-01-24 01:24

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

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-01-24 03:51

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
Attachments
Capture.PNG
Capture.PNG (113.56 KiB) Viewed 3576 times

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-01-26 00:06

any result?

User avatar
a.gneady
Site Admin
Posts: 923
Joined: 2012-09-27 14:46
Contact:

Re: Issue with the database backup on the new version

Post by a.gneady » 2018-01-26 23:07

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
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-01-29 06:59

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

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-01-30 02:49

Updating my hosted service php to 5.6 FPM worked a treat.

just working on the localhost to get that working properly

User avatar
a.gneady
Site Admin
Posts: 923
Joined: 2012-09-27 14:46
Contact:

Re: Issue with the database backup on the new version

Post by a.gneady » 2018-01-30 08:17

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.
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-01-31 06:51

No error from the XHR tab but there are other errors... see attached
Attachments
appgini error.PNG
appgini error.PNG (51.04 KiB) Viewed 3438 times

User avatar
a.gneady
Site Admin
Posts: 923
Joined: 2012-09-27 14:46
Contact:

Re: Issue with the database backup on the new version

Post by a.gneady » 2018-01-31 09:45

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.
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-02-01 04:25

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

User avatar
a.gneady
Site Admin
Posts: 923
Joined: 2012-09-27 14:46
Contact:

Re: Issue with the database backup on the new version

Post by a.gneady » 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.
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

User avatar
baudwalker
Veteran Member
Posts: 95
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Issue with the database backup on the new version

Post by baudwalker » 2018-02-05 03:16

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."

User avatar
a.gneady
Site Admin
Posts: 923
Joined: 2012-09-27 14:46
Contact:

Re: Issue with the database backup on the new version

Post by a.gneady » 2018-02-11 10:41

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.
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

Post Reply