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

    Join Date
    Dec 2009
    Posts
    103
    Rep Power
    5

    Panel.byethost.com mysql question


    Ive been trying to learn php, and Ive just gotten to the chapter about mysql and im trying to test it on my web site, which uses http://panel.byethost.com/
    http://panel.byethost.com/ provides some mysql control, but i don't want to use it, i want to send every command through php, because im trying to learn php. so i grabbed some code from w3schools.com and inserted my username, password and mysql host name into it. i uploaded the code onto the server, ran it and got this error:

    Could not connect: Access denied for user 'space_4826174'@'192.168.0.110' (using password: YES)

    heres my code, or rather, the code from w3schools.com:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>mysql test</title>
    </head>
    <body>
    <?php
    $con = mysql_connect("sql307.000space.com","spa…
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    
    if (mysql_query("CREATE DATABASE my_db",$con))
    {
    echo "Database created";
    }
    else
    {
    echo "Error creating database: " . mysql_error();
    }
    mysql_close($con);
    ?>
    </body>
    </html>
    im absolutely sure that i have the correct username, password and host. anyone who uses http://panel.byethost.com/ knows that the mysql username and password are the same ones u use to log into cpanel or access via ftp. and once u log into http://panel.byethost.com/, it tells u right away what the mysql host is, here ill copy and paste it:
    MySQL hostname: sql307.000space.com

    so why did i get this error?
  2. #2
  3. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,186
    Rep Power
    2265
    I would contact your host and verify the mysql connection parameters (URL, port, and if you haven't set your own user/pass, the defaults for those).
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,905
    Rep Power
    6351
    PHP Code:
    $con mysql_connect("sql307.000space.com","spa…"); 
    You don't have an http:// in front of that URL, you need it otherwise sql307.000space.com is used as a hostname, and if it's not found it defaults to localhost (or the MySQL server in php.ini). The error message you're getting represents a failure for a 192 IP address, which is something on your local network.

    -Dan
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    103
    Rep Power
    5
    turns out that if your host uses panel.byethost.com, you cant create databases via php u have to do it in the panel, i just hope they dont waste any more of my time on things like this
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,905
    Rep Power
    6351
    That may be true, but it had nothing to do with your actual error.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    turns out that if your host uses panel.byethost.com, you cant create databases via php u have to do it in the panel, i just hope they dont waste any more of my time on things like this
    That is actually an almost universal standard for shared web hosts, both free and paid. For security reasons virtually all shared web hosts require you to create / delete database and database users from their control panel rather than through queries.

IMN logo majestic logo threadwatch logo seochat tools logo