MySQL Server for mysql_connect()

shawntc

Member
Messages
70
Reaction score
0
Points
6
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:

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
You need to use 'localhost'. Although it is not technically the same server, you will code your scripts as though it is.
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
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? ;)
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
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".
 
Top