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!

Adding MySQL user via script.

Discussion in 'General Discussion' started by fwwebs, Sep 14, 2004.

  1. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    166
    I've created a PHP script to add a MySQL database and user with permissions to the database. The database and user adds fine, except for the password. The user is given the correct permissions for the appropriate database, as verified by cPanel, but they can't connect to the database because of a password error. I can go into cPanel and recreate the user with the same exact username and password and connection to the database is then possible. No changing permissions or adding the user to a database is necessary, as it was done by the script originally. At first I thought that the password was corrupt, so I editted the script to show the cPanel output and cPanel shows all of the correct information for the username and password.

    Any Ideas.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    166
    Anyone ever try a script like this?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cguimont

    cguimont Well-Known Member

    Joined:
    Jul 13, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    166
    I am not sure whether the password you need to send to MYSQL is encrypted...

    If so, check your encryption.
     
  4. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    166
    The output from cPanel when adding the MySQL user shows the correct username and password, the same as when added through cPanel itself.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice