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.
nycwebmaster
Veteran Member
Posts: 90
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: 1281
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
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
baudwalker
Veteran Member
Posts: 188
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 16911 times

User avatar
baudwalker
Veteran Member
Posts: 188
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: 188
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 16907 times

User avatar
baudwalker
Veteran Member
Posts: 188
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: 1281
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
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
baudwalker
Veteran Member
Posts: 188
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: 188
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: 1281
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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
baudwalker
Veteran Member
Posts: 188
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 16769 times

User avatar
a.gneady
Site Admin
Posts: 1281
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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
baudwalker
Veteran Member
Posts: 188
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: 1281
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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
baudwalker
Veteran Member
Posts: 188
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: 1281
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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Issue with the database backup on the new version

Post by dharbitindy » 2019-06-07 01:47

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

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

Re: Issue with the database backup on the new version

Post by a.gneady » 2019-06-13 13:18

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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

sacgtdev
Veteran Member
Posts: 75
Joined: 2020-06-10 11:14

Re: Issue with the database backup on the new version

Post by sacgtdev » 2020-12-28 15:21

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.

federico
Veteran Member
Posts: 74
Joined: 2020-10-29 14:52

Re: Issue with the database backup on the new version

Post by federico » 2021-06-05 09:41

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

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Issue with the database backup on the new version

Post by jsetzer » 2021-06-07 05:56

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/
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

federico
Veteran Member
Posts: 74
Joined: 2020-10-29 14:52

Re: Issue with the database backup on the new version

Post by federico » 2021-06-13 09:25

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?

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Issue with the database backup on the new version

Post by jsetzer » 2021-06-14 07:42

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.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

federico
Veteran Member
Posts: 74
Joined: 2020-10-29 14:52

Re: Issue with the database backup on the new version

Post by federico » 2021-06-15 15:03

Hi Jan
yes of course. I use Xampp and MySQL is on the port 3307. Just checked again

federico
Veteran Member
Posts: 74
Joined: 2020-10-29 14:52

Re: Issue with the database backup on the new version

Post by federico » 2021-06-15 15:11

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

Post Reply