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.

MySql db login problems

Discussion in 'General Discussion' started by trout21, Apr 14, 2004.

  1. trout21

    trout21 Well-Known Member

    Joined:
    Apr 2, 2004
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    Hello.

    I am attempting to log into a database that is on a site - This site I have moved to my new server. I have created a db and a user and a password the same as in my script, though with cPanel they have mysite_ appended to the front of them -

    these are:

    mysite_mydb
    mysite_myuser
    password

    and in my script I have changed the appropriate areas according to the new cPanel names:

    $dbhost = "mysite";
    $dbuser = "mysite_myuser";
    $dbpassword = "password";
    $db = "mysite_mydb";

    though it keeps tripping up and cannot access the $db! Does anyone know why not? This script worked fine before!?

    Thank you for any reply.
    trout21

    I might add that I also had to enter % as a host to be able to access the without getting an error.
     
  2. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Use
    $dbhost = "localhost";
    which is most probably what you really need.
     
  3. hshan

    hshan Registered

    Joined:
    Mar 28, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Simple but possibly overlooked.... add the newly created user to the database in cpanel.
     
  4. trout21

    trout21 Well-Known Member

    Joined:
    Apr 2, 2004
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    still not working

    Thank you for your replies.

    I had created the user but had not given them privaledges to the db in question.... sleep deprivation does stupid things to the mind!! :(

    Regards,
    trout
     
    #4 trout21, Apr 15, 2004
    Last edited: Apr 15, 2004
Loading...

Share This Page