Backup Errror at Admin Page

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
soewandi
Veteran Member
Posts: 38
Joined: 2019-11-20 14:00

Backup Errror at Admin Page

Post by soewandi » 2025-03-07 10:54

I've got error message: Got error: 1045: "Access denied for user 'someone'@'::1' (using password: YES)"; when I want to make backup in Admin Page of my app.
FYI: I make database in local computer without password. I make database in remote server with password. How can I solve that problem? Many thanks for your help.

My regards,
Soewandi

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

Re: Backup Errror at Admin Page

Post by a.gneady » 2025-03-09 13:09

This error usually appears when MySQL tries to connect using IPv6 (which comes through as '::1') rather than the standard IPv4 localhost (127.0.0.1). MySQL distinguishes hosts based on literal IP addresses, so a user with privileges for 'localhost' might still be denied if the connection is recognized as '::1'.

Here are a few possible causes and how to fix them:
  • The MySQL user doesn’t have permissions for '::1'. Make sure you’ve granted the necessary privileges to 'someone'@'::1'. For example, you can run something like:

    Code: Select all

    GRANT ALL PRIVILEGES ON your_database.* TO 'someone'@'::1' IDENTIFIED BY 'strong-password';
    FLUSH PRIVILEGES;
    (Adjust privileges according to your security needs.)
  • The MySQL user is only defined for 'localhost' or some other host. If you see an entry for 'someone'@'localhost' in MySQL, but not for 'someone'@'::1', you might need to create it or modify it to ensure the user has the same privileges on '::1'.
  • mysqldump command is connecting incorrectly. If your AppGini app triggers mysqldump without explicitly specifying IPv4, it might default to IPv6. One workaround: specify the host as 127.0.0.1 (IPv4) in your backup logic. For example:

    Code: Select all

    // within the backup script logic inside the admin area
    $cmd = "mysqldump -h 127.0.0.1 -u someone -p'your_password' your_database > backup.sql";
    exec($cmd, $output, $return_var);
    Adjust the command to match your database details and file paths.
In summary, to resolve the “Access denied for user 'someone'@'::1' (using password: YES)” error, ensure MySQL recognizes 'someone'@'::1' and grants it the needed privileges, or enforce IPv4 in the mysqldump command. Once you correct the user host settings or the host parameter, the backup should work normally.
:idea: AppGini plugins to add more power to your apps:

soewandi
Veteran Member
Posts: 38
Joined: 2019-11-20 14:00

Re: Backup Errror at Admin Page

Post by soewandi » 2025-03-10 11:00

Many thanks Ahmed for your fast response and explanation. I will try to resolve it.

soewandi
Veteran Member
Posts: 38
Joined: 2019-11-20 14:00

Re: Backup Errror at Admin Page

Post by soewandi » 2025-03-10 11:31

Update: I success running Database Backup in my local computer (database without password), through edit or change pageBackupRestore.php in line 338 from:
<code>
$pass_param = ($config['dbPassword'] ? " -p{$config['dbPassword']}" : '');
</code>

to:
<code>
$pass_param = ((empty($config['dbPassword']) || $config['dbPassword']=='""') ? "" : "-p{$config['dbPassword']}" );
</code>

This is the feedback command after success backup in my local computer:
<code>
(mysqldump -y -e --no-autocommit -q --single-transaction -u"root" -P "3306" -h"localhost" "jemaatgkis" -r "C:/xampp/htdocs/jemaatgkis/admin/backups/d7ede62544bd773d3.sql") 2>&1
</code>

But the new edited file in remote server (hosting) did not success to backup as expected.
What is the problem?

ppfoong
Veteran Member
Posts: 62
Joined: 2021-07-13 16:46

Re: Backup Errror at Admin Page

Post by ppfoong » 2025-03-11 16:21

You need to have mysqldump in your hosting server.

A good practice is to include its full path when calling it. Eg.: /usr/local/bin/mysqldump .....

Post Reply