Community Forums
Connect with us on LinkedIn
  
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    1

    Default MySql

    Hi,

    I am quiet new to Cpanel and webhosting. I have came across several question, from which many of them occurred since i dont have much experience.

    So my problem is that, on localhost i have created a database with some applications, and its working nicely, however, when i upload it to the server, i cant use it, and i cant connect to my database what i have made.

    <?

    $connection = mysql_connect("localhost","black","white");
    mysql_select_db("colors", $connection);

    ?>

    this is nicely working on localhost, but not on the server, how should i modify the coding that will work online? I think i need to write something instead of localhost, but i dont know what it should be.

    If you could tell me the formula, that would help me a lot...

    thank you

    Mywheel

  2. #2
    Member
    Join Date
    Jan 2008
    Posts
    141

    Default

    First of all you will have to create the database from your cPanel and then need to create the database user to gain access to the particular database and then try to connect your database. If you still fail then try to use the IP address of your MySQL server replace to localhost and have a try.

Similar Threads & Tags
Similar threads

  1. Replies: 13
    Last Post: 06-15-2010, 04:31 PM
  2. Replies: 13
    Last Post: 06-15-2010, 04:31 PM
  3. Remote MySQL and /var/lib/mysql/mysql.sock
    By emechanic in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-02-2009, 01:08 PM
  4. Replies: 1
    Last Post: 04-21-2007, 01:23 AM
  5. Replies: 0
    Last Post: 06-27-2004, 02:53 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube