Closed Thread
Results 1 to 7 of 7

Thread: Database Connection Problem

  1. #1
    cjbonn2005 is offline x10Hosting Member cjbonn2005 is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    4

    Question Database Connection Problem

    I'm trying to connect to my database but it wont let me, I have localhost as host, (username)_(DB name) as username. But what do I put for the password. I put what I do to log into the cP, but that fails.
    It would be alot simpler if we could assign our own password to that database WHEN we create it.
    But what would my password for it be?

  2. #2
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    510

    Re: Database Connection Problem

    Just go to your CPanel > Databases > MySQL Databases and create a username and password for your database.


  3. #3
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Database Connection Problem

    Do exactly what gomarc said, and also make sure when you create a user that you give it privileges to access the database, otherwise you will get an error
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  4. #4
    cjbonn2005 is offline x10Hosting Member cjbonn2005 is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    4

    Re: Database Connection Problem

    It doesn't offer me an option to create one, it just says something like type a name for the database, then it just inputs it... no option to insert username and pass. Unless the username and pass is what the "Users" section is for o.0?

  5. #5
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Database Connection Problem

    It's at the bottom of the page. You have to create a new user (if you haven't already) then "add user to database" and give all privileges (grant privilege is probably unnecessary if you want to be more strict about your security).
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  6. #6
    sbflinn is offline x10Hosting Member sbflinn is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    15

    Re: Database Connection Problem

    i have problems getting connected after i put my database info and stuff into scripts
    is that from my end or ??
    i got all the correct info, ive checked it bunch of times. and idk

  7. #7
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    510

    Re: Database Connection Problem

    @ cjbonn2005

    Make sure you are selecting the MySQL Databases (NOT the Wizard). Here is a link to a video tutorial http://www.cpanel.net/media/tutorials/addmysql.htm so you can see it in action.

    ------------------------------

    @ sbflinn

    You may want to open a new thread posting your script so someone can help. (Obviously, replace your real username and password)

Closed Thread

Similar Threads

  1. Remote Database Connection
    By ShoutX in forum Free Hosting
    Replies: 6
    Last Post: 10-04-2007, 10:22 PM
  2. Allow external connection to MySQL database
    By pedubreuil in forum Free Hosting
    Replies: 3
    Last Post: 10-04-2007, 11:17 AM
  3. Mysql connection problem
    By shroomin in forum Free Hosting
    Replies: 5
    Last Post: 08-04-2005, 06:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers