Closed Thread
Results 1 to 3 of 3

Thread: Database Error

  1. #1
    masterb163 is offline x10Hosting Member masterb163 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    2

    Database Error

    Hey I was trying to install a database script to my free hosting with you all, but when I tried to install it I got this message. Database connection failed!
    Double-check all the information below. If not sure contact your hosting company for the correct information!
    MySQL said: Access denied for user 'cbryant2'@'int.web3.vital.x10hosting.com' (using password: YES), I haven't reached the allowed databases yet at least I don't think I have could you tell me whats going on. FYI: I did use the correct login credentials.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: Database Error

    1. Make sure the host is 'localhost'
    2. In general, you connect using the database user you created in MySQL Databases and then attached to the database with ALL PRIVILEGES
    The username is of the format cbryant2_igor .
    3. You can connect using cPanel username and password, but that is not usual.
    4. A simple script that should work to make sure all your info is correct:

    PHP Code:
    <?php
    $host 
    'localhost' ;
    $db 'gerbil_dbname' ;
    $user 'gerbil_dbuser' ;
    $pass 'SayTheSecretWord' ;
    echo 
    "<pre>" ;
    try {
        
    $dbh = new PDO("mysql:host=$host;dbname=$db"$user$pass);
        foreach(
    $dbh->query('SHOW TABLES') as $row) {
            echo 
    $row[0] . "\n" ;
        }
        
    $dbh null;
    } catch (
    PDOException $e) {
        print 
    "Error!: " $e->getMessage() . "<br/>";
        die();
    }

    echo 
    "</pre>";
    Nothing is always absolutely so.

  3. #3
    masterb163 is offline x10Hosting Member masterb163 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    2

    Smile Re: Database Error

    It looks like the issue is resolved I just created a new database user, instead, of using my cPanel login.

Closed Thread

Similar Threads

  1. Replies: 1
    Last Post: 10-12-2010, 12:17 PM
  2. Database Error: Unable to connect to the database
    By paolix77 in forum Free Hosting
    Replies: 1
    Last Post: 04-26-2010, 10:38 PM
  3. Replies: 5
    Last Post: 04-25-2010, 04:02 PM
  4. Replies: 1
    Last Post: 04-17-2010, 12:26 PM

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