Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysqldump: Got error: 1045: Access denied for user

Discussion in 'EasyApache' started by Nirjonadda, Aug 30, 2017.

  1. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    417
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Please let me know that how to fix mysqldump: Got error: 1045: Access denied for user?

    Code:
    [30-Aug-2017 02:02:00] WARNING: [pool mysite_com] child 13234 said into stderr: "mysqldump: Got error: 1045: Access denied for user 'user'@'localhost' (using password: YES) when trying to connect"
    
     
  2. Eminds

    Eminds Well-Known Member

    Joined:
    Nov 10, 2016
    Messages:
    211
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    you must be logged in with the root user to the server in order to create mysqldump. while backing up the data use -u root -p mysql password root password and then check.
     
  3. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    417
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    I am using one addon for xenforo ForumBackup. It appears the user connecting to my xenforo database doesn'f have authority to use the mysqldump command? mysql password is root password have set up in“.my.cnf” in home directory. Please let me know that how we can fix this problem?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Are you able to verify the correct database username and database name is utilized by your script's plugin when attempting to backup the database? Also, try accessing SSH as the account username and running the following command to verify it works as expected:

    Code:
    mysqldump -u username -p database_name > /home/$username/db_backup.sql
    Thank you.
     
  5. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    417
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    No, plugin does not have any option to enter database username and database name. Its just work from Xenforo Database. This issue happened from new server. Yes following command are working but with this command where the database files are save?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    The backup files are located at "/home/$username/db_backup.sql" in this example. As far as the plugin, could you report the issue to the plugin developer to see how the MySQL backup is generated in the code?

    Thank you.
     
  7. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    417
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    I think Its happened from after using php-fpm.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Do you notice any specific output in /opt/cpanel/ea-php$$/root/usr/var/log/php-fpm/error.log when this happens? Replace "ea-php$$" with the version of PHP associated with the account (e.g. ea-php56).

    Thank you.
     
  9. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    417
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    /opt/cpanel/ea-php71/root/usr/var/log/php-fpm/error.log

    Code:
    [07-Sep-2017 02:01:06] WARNING: [pool mysite_com] child 23116 said into stderr: "mysqldump: Got error: 1045: Access denied for user 'nadda'@'localhost' (using password: YES) when trying to connect"
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you verify that no additional entries appear in that log file before or after that error message near the same time stamp?

    Thank you.
     
  11. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    417
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Before or After, No error logged in same time.
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look.

    Thank you.
     
  13. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    417
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Support Request ID is: 8852133
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, it looks like this stemmed from the use of a my.cnf file in the account's home directory with a password that did not match the cPanel account's password.

    Thank you.
     
Loading...

Share This Page