+ Reply to Thread
Results 1 to 5 of 5

Thread: MySQL Server for mysql_connect()

  1. #1
    shawntc is offline x10Hosting Member shawntc is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    62

    MySQL Server for mysql_connect()

    What would be the name of the MySQL server for this command? I'm on Boru, if that helps anyone. Would it be http://boru.x10hosting.com: and then the number that comes after that, as it appears in the URL bar? Or would it be http://boru.x10hosting.com:3306, since 3306 is the port for MySQL servers?

    Edit: hehe, just realized that the PHP script for this would reside and run on the server itself, so why not just use "localhost" or "localhost:3306"... of course, if that's the right thing to use.
    Last edited by shawntc; 07-04-2010 at 05:58 PM.
    For God so loved the world that he gave is one and only son, that whoever believes in him shall not perish but have eternal life. - John 3:16
    MY SITE!

  2. #2
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: MySQL Server for mysql_connect()

    You need to use 'localhost'. Although it is not technically the same server, you will code your scripts as though it is.

  3. #3
    shawntc is offline x10Hosting Member shawntc is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    62

    Re: MySQL Server for mysql_connect()

    And I don't need to include :3306, correct?
    For God so loved the world that he gave is one and only son, that whoever believes in him shall not perish but have eternal life. - John 3:16
    MY SITE!

  4. #4
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: MySQL Server for mysql_connect()

    You can include the :3306 (making it localhost:3306), but you don't have to since 3306 is the standard port.
    If the server would - for example - run on the non-standard port 54032 you'd have to use localhost:54032. But standards make life easier, so why not stick to them? ;)
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: MySQL Server for mysql_connect()

    You can also leave off the port number because, when using a hostname of "localhost", the port is immaterial. The PHP MySQL client drivers use a Unix socket (on Unixen) or named pipe (under Windows) when the hostname is "localhost".
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Please help me on mysql_connect
    By sirSam in forum Programming Help
    Replies: 24
    Last Post: 02-17-2009, 01:38 AM
  2. Replies: 2
    Last Post: 12-17-2007, 03:00 AM
  3. Warning: mysql_connect() [function.mysql-connect]:
    By acidkillz2001 in forum Free Hosting
    Replies: 4
    Last Post: 11-15-2007, 01:47 PM
  4. Replies: 0
    Last Post: 11-15-2007, 05:11 AM
  5. Warning: mysql_connect() [function.mysql-connect]:
    By marsmari in forum Free Hosting
    Replies: 3
    Last Post: 11-15-2007, 01:27 AM

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