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 problem

Discussion in 'General Discussion' started by fishfreek, May 7, 2004.

  1. fishfreek

    fishfreek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    238
    Likes Received:
    0
    Trophy Points:
    16
    A client is trying to setup a mysql dump command to run during cron. THe problem is he is getting a permission denied message for the username he is trying to use on the dump.

    The username and password is assocated with the database but it will only let us run the mysqldump command with the mysql user root and roots password.

    It shoudl not do this since the username thats assocated with the database has full permissions.
     
  2. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Can you post the command line sytnax your using or how your trying to execute the mysqldump via the cronjob ?

    Mickalo
     
  3. fishfreek

    fishfreek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    238
    Likes Received:
    0
    Trophy Points:
    16
    Obviously the correct username and password is substituted for those in the commandline and the correct username_database name and tablename is substituted in the commandline.

    It works if its --user=root --password=(rootpassword) If I make it anything else it bombs out. I cant even use the main username and password assocated with that account. So im fairly certin the syntax is correct else it woudl not work with even the root username and password.
     
  4. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    have you tried using the --defaults-file=/home/username/.my.cnf instead of the --username and --password options?

    Create a .my.cnf configuration file with the account's DB access info, then try it.

    I've done this many of our accounts that want auto nightly backups, using mysqldump and works fine, as long as they have full privileges to the database that's being accessed.

    Mickalo
     
  5. fishfreek

    fishfreek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    238
    Likes Received:
    0
    Trophy Points:
    16
    What would teh format of the .my.cnf file be?
     
  6. fishfreek

    fishfreek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    238
    Likes Received:
    0
    Trophy Points:
    16
    Ok i think i found the format. Soemething like

    user=username
    password=password

    Anyway I put that in a .my.cnf file in the home directory of the user and ran the command and once again I get

    Why would only the root mysql user be able to do a database dump?
     
  7. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    If the account db privileges are set up correctly, they should be able to utilize the mysqldump.

    A typical .my.cnf looks something like this:
    Code:
    [client]
    user        = username
    password = password
    host        = localhost
    
    what MySQL version are you running, and is this a standard install or custom installation ??

    Mickalo
     
  8. fishfreek

    fishfreek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    238
    Likes Received:
    0
    Trophy Points:
    16
    Its a standard install as best I know. Its a server matrix server that we just got setup a few days ago.

    Mysql version 4.0.18-standard

    Per cpanel the user im trying has full permissions. Even the main account username doesnt work.

    For example lets say the account's username is abc123 and its cpanel password zxcvb and the database user thats setup in cpanel is abc123_xyz987 with password asdfg.

    WHen i try to use

    --user=abc123_xyz987 --password=asdfg

    OR

    --user=abc123 --password=zxcvb

    I get the mysqldump error. Not sure if this maters but this account was moved using one of the move scripts.
     
  9. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Well what I would do is login as root, then verify that this account has the correct db privileges setup for the database they are trying to "dump" or create the correct privileges then do a flush-privileges to make sure the changes took affect...

    Mickalo
     
Loading...

Share This Page