#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    64
    Rep Power
    2

    Mysqldump trouble


    I'm trying to throw a sql backup script together, but for some reason I cannot get mysqldump to create the file. The directory has all permissions enabled. This is my first time using mysqldump so there could be something wrong with the syntax.

    Partial:

    PHP Code:
    $backupfile $dbname date("Y-m-d") . '.sql';
    system("mysqldump -h $dbhost -u $dbuser -p $dbpass $dbname > $backupfile"); 
    NOTE: All the config variables have been set with the correct information.

    If someone could help me out I'd really appreciate it.
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,294
    Rep Power
    9400
    Put the command into a variable and echo the variable. Does it work if you try running it manually?
  4. #3
  5. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    If you use the short option form (-p), you cannot have a space between the option and the password.
    ..
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    64
    Rep Power
    2
    I removed the space after -p and I set the line as a variable and tried echoing it, but still no luck. I do appreciate the help.

    I just got back in front of the computer so I'll keep playing around with it for the next couple hours, and hopefully I'll be able to get it working.

IMN logo majestic logo threadwatch logo seochat tools logo