Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Mar 2007
    Posts
    20

    Default How to back up MySQL database?

    Hello everyone,

    I need to back up my database using this command:

    mysqldump --opt -Q -u database_user -p database_name > mydatabase.sql

    but it asked for the password, I enter the password for that database_user but it said :
    mysqldump: Got error: 1045: Access denied for user 'timbanga_timbang'@'localhost' (using password: YES) when trying to connect.

    What should I do? I enter password correctly though.

    Sincerely,
    Calvin

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How to back up MySQL database?

    Hello Calvin,

    You would need to either use the root user without passing the -p flag or the cPanel username user rather than the cPanel database username, so timbanga user's password for cPanel and MySQL instead:

    Code:
    mysqldump --opt -Q -u timbanga -p database_name > mydatabase.sql
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Mar 2007
    Posts
    20

    Default Re: How to back up MySQL database?

    Hi Tristan,

    It doesn't work either. The same error message!

    Please help! Thank you.

    Regards,
    Calvin

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How to back up MySQL database?

    Did you try as the root user? Are you certain that is the MySQL username and password for that user? If it is the right MySQL password for the user, then this command will work:

    Code:
    mysql -u timbanga -p
    When prompted for the password for the timbanga user, then enter it. If it lets you into MySQL, then the password is right. If it doesn't let you into MySQL, then that isn't the user's MySQL password.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  5. #5
    Member
    Join Date
    Mar 2007
    Posts
    20

    Default Re: How to back up MySQL database?

    Hello,

    I even tried the password for user "root" but it still didn't work. I have the config file with the password I set, I guarantee it is correct but I don't know why it keeps giving that error message!



    Please help.

    Thank you.

    Regards,
    Calvin

  6. #6
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How to back up MySQL database?

    If it was me I think I'd just go to my cPanel, click this users name in Databases section and give him a new password and then try that password with my backup command. To troubleshoot, basically. If it works be sure to update that config file with the new password.

    GL!

  7. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How to back up MySQL database?

    Can you even enter MySQL command line on the machine in question?

    Code:
    mysql
    Please enter that in root SSH when logged in as the root user. If you receive an error, please indicate it here.

    If you can log into that service, then open up a ticket. The root user when *not* passing the -p flag using mysqldump should always work if you are logged in as root. As such, if you tried as root user and did not pass the -p flag, it shouldn't have rejected the command. There's something wrong with MySQL if it did.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Replies: 0
    Last Post: 01-17-2011, 12:42 PM
  2. How to back up mysql database using cron jobs?
    By guymelef in forum Database Discussions
    Replies: 4
    Last Post: 02-19-2010, 04:52 AM
  3. Cron Job to back up MySQL database
    By BMR777 in forum New User Questions
    Replies: 1
    Last Post: 01-30-2010, 06:24 PM
  4. How to Back up database and/or files by setting up a cron?
    By Binesh in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 11-11-2004, 02:14 PM
  5. Replies: 3
    Last Post: 07-19-2003, 09:34 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube