+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Please help me on mysql_connect

  1. #1
    sirSam is offline x10Hosting Member sirSam is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    10

    Please help me on mysql_connect

    hello guys, im a newbie in php.
    i have a line of code like the following
    mysql_connect("localhost",...
    i uploaded my page using my account under elementfx server.
    my problem is this:
    Unknown MySQL server host 'Starka.x10 '
    i think i should change the "localhost" to an IP address, or should really I?
    I hope you can help me on here..
    thanks in advance.. more power x10hosting;)

  2. #2
    Silmaril is offline x10Hosting Member Silmaril is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    13

    Re: Please help me on mysql_connect

    Hi sam.

    localhost is correct. Habe you made the database you are trying to access with your script? you should do this first in cpanel

  3. #3
    sirSam is offline x10Hosting Member sirSam is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    10

    Re: Please help me on mysql_connect

    hello Silmaril, thanks so much for your reply.

    i already made the database using the phpMyAdmin tool from cPanel.
    did i create it the wrong way? should I have used the wizard?

    thanks again..
    Last edited by sirSam; 02-16-2009 at 06:13 AM.

  4. #4
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: Please help me on mysql_connect

    did you assign the user to the database the correct permissions?
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  5. #5
    sirSam is offline x10Hosting Member sirSam is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    10

    Re: Please help me on mysql_connect

    i am getting a new error here:
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sirSam'@'localhost' (using password: YES) in...
    Access denied for user 'sirSam'@'localhost' (using password: YES)
    Edit:
    hi leafypiggy...
    i think i have not done that yet..
    can you guide me pls?
    Last edited by sirSam; 02-16-2009 at 06:23 AM. Reason: Automerged Doublepost

  6. #6
    Silmaril is offline x10Hosting Member Silmaril is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    13

    Re: Please help me on mysql_connect

    i messed my post up!

    okay, mine is like this

    localhost
    dbname = silmaril_nuke
    user = silmaril_silmaril
    pass = mypass

    notice the silmaril_ part......... that is cpanellogin_dblogin which makes up your complete login.

    As for the permissions bit, the permissions were set up when i set up the user on mine, but i didnt use myphpadmin i used the first icon in there called MySQL Databases
    Last edited by Silmaril; 02-16-2009 at 06:29 AM. Reason: Automerged Doublepost

  7. #7
    sirSam is offline x10Hosting Member sirSam is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    10

    Re: Please help me on mysql_connect

    i have already created the user for the database and set all the privileges

  8. #8
    xxll_martin_llxx is offline x10 Elder xxll_martin_llxx is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    716

    Re: Please help me on mysql_connect

    Firstly, if you're looking to use databases then it's likely you'll be need PHP too - you've only got the Basic PHP level which usually creates more errors and stops sites functioning properly. You will need to login at http://x10hosting.com/account and request the INTERMEDIATE level of php.

    Secondly, please refer to my post http://forums.x10hosting.com/free-ho...tml#post522016 to sort your current problem out.

  9. #9
    sirSam is offline x10Hosting Member sirSam is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    10

    Re: Please help me on mysql_connect

    thanks anyway Silmaril. i was so hopeless when i was waiting so your reply is already a help

  10. #10
    Silmaril is offline x10Hosting Member Silmaril is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    13

    Re: Please help me on mysql_connect

    LoL thats nice of you but really, i was of no help at all but look!!! the pro's are here ;)

+ Reply to Thread
Page 1 of 3 123 LastLast

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