noob sql question

matzomeal

New Member
Messages
4
Reaction score
0
Points
0
I want to connect to my SQL database, but I'm not sure what to use as the host name. Is it localhost like I've seen in a bunch of tutorials? The name of the database is matzo_friendbase. Is the host matzomeal.x10hosting.com? I'm just a little confused...
 

gomarc

Member
Messages
516
Reaction score
18
Points
18
localhost worked for me

Yes, your host name is indeed “localhost”.

Have you created a user/password for this database?
If not, go back to your CPanel > MySQL Databases and use the “Add New User” give the proper permissions and then do the “Add User To Database” step.

Then you’ll be ready to go.
 

fguy64

New Member
Messages
218
Reaction score
0
Points
0
yeah, thanks gomarc.

How do you distinguish between application server and database (file) server? I'm thinking "localhost" probably denotes the application server, and probably the actual location of the databases is something only the application server needs to know. Is this a correct way of looking at things?

regards.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
"localhost" is the local computer, whichever computer a program happens to be running on. As a network address, it resolves to 127.0.0.1, the address for the loopback device, in IPv4. A loopback device is a virtual network device where all traffic is routed back to itself. It's like a phone that can only call itself.
 

fguy64

New Member
Messages
218
Reaction score
0
Points
0
Ha ha there's no place like 127.0.0.1. funneee. People, notice the redirect on 127.0.0.1 in the previous post.

Anyways this would imply that on X10 the mysql_connect statement makes a connection to the same machine the php server lives on.

Still wondering about differences between application server and file server in the MySQL context, but there's no hurry for that.

Thanks.

"localhost" is the local computer, whichever computer a program happens to be running on. As a network address, it resolves to 127.0.0.1, the address for the loopback device, in IPv4. A loopback device is a virtual network device where all traffic is routed back to itself. It's like a phone that can only call itself.
 

vol7ron

New Member
Messages
434
Reaction score
0
Points
0
Anyways this would imply that on X10 the mysql_connect statement makes a connection to the same machine the php server lives on.

Still wondering about differences between application server and file server in the MySQL context, but there's no hurry for that.

I think your question about servers will confuse most people on this site, rather than help them. This is because people typically refer to servers as the actual machine hosting the interaction w/ the client; to simplify: the hardware.

What you are questioning is in regards to virtual and/or application servers. These can reside on one or multiple machines, because it is software driven.

If you want to know more about the partitioning and tablespace management of MySQL or PostgreSQL, you will need to ask an admin by opening the ticket. My guess is that you still will not get a response, unless you're a paid member. In which case, if it truely affects your operations, then you would not be paying for hosting, you'd run your own dedicated server.

My guess, though, is that the services x10 provides is all on the same hard drive. This seems to be because when one goes offline (like Lotus), it doesn't effect any of the others.
 

OdieusG

New Member
Messages
50
Reaction score
0
Points
0
I think your question about servers will confuse most people on this site, rather than help them. This is because people typically refer to servers as the actual machine hosting the interaction w/ the client; to simplify: the hardware.
Exactly....
What you are questioning is in regards to virtual and/or application servers. These can reside on one or multiple machines, because it is software driven.
By default, yes. SQL servers run on (usually) port 3306. HTTP servers (where your HTML pages are served) are port 80....
If you want to know more about the partitioning and tablespace management of MySQL or PostgreSQL, you will need to ask an admin by opening the ticket. My guess is that you still will not get a response, unless you're a paid member. In which case, if it truely affects your operations, then you would not be paying for hosting, you'd run your own dedicated server.
Paid hosting is the best, and on X10, affordable as h***. I have the $7.95 a month package and is well worth the money a month.
My guess, though, is that the services x10 provides is all on the same hard drive. This seems to be because when one goes offline (like Lotus), it doesn't effect any of the others.
Correct (not the hard drive thing...dunno about that)....that's why there are so many servers. The paid servers have less downtime since some people can't dish out money at all times for a webspace. In addition, the free servers are beaten to a pulp (either intentionally or not) by people that run scripts and it causes server overload and general messup on them. They can be pointed to multiple locations.....could be one right next door to you and you wouldn't know it

Hope this clarifies a bit.....no I'm not an admin here, I just know technical knowledge about this stuff
 
Last edited:

fguy64

New Member
Messages
218
Reaction score
0
Points
0
duly noted vol7ron and OdeusG, thanks.

It doesn't really affect how we do things, I was just curious. For my own interest, your explanations seem to imply that in the mysql_connect statement, localhost refers to a physical machine, and by default the mySQL client looks to a specific port on that server machine that the server application listens to, as there may be other applications listening on different ports on that server.

Sorry if I'm long winded. Thanks again.
 

daman371

New Member
Messages
130
Reaction score
0
Points
0
Localhost is used when you're using a SQL on the computer running the script. You can connect remotely using the address of the server. This usually isn't used but it can be.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
It doesn't really affect how we do things, I was just curious.
It's nice to understand how things work, isn't it?

For my own interest, your explanations seem to imply that in the mysql_connect statement, localhost refers to a physical machine, and by default the mySQL client looks to a specific port on that server machine that the server application listens to, as there may be other applications listening on different ports on that server.
Almost. On a VM, localhost is the VM (as opposed to the physical machine running the VM or any other VMs running on the physical machine). For a program running on bare iron, localhost is the physical machine.
 

vol7ron

New Member
Messages
434
Reaction score
0
Points
0
duly noted vol7ron and OdeusG, thanks.

It doesn't really affect how we do things, I was just curious. For my own interest, your explanations seem to imply that in the mysql_connect statement, localhost refers to a physical machine, and by default the mySQL client looks to a specific port on that server machine that the server application listens to, as there may be other applications listening on different ports on that server.

Sorry if I'm long winded. Thanks again.


No, they're good questions, but you might not be able to get a correct answer about the tablespace and partitioning set up.

By default x10 uses localhost as the manager to find the correct installation. This is used for two reasons that I know of. 1) It is the default that PostgreSQL and MySQL give you and 2) x10 uses it for security. x10 doesn't allow database hosting. Meaning, you can't create a database here and connect to it by a script from another site. Your script has to be housed here too. This is partly controlled by forcing scripts to use "localhost" instead of hard-coded IPs, in addition to the referring URL.

The second part of your question asks about the ports, which you may need for php or Perl DBI connect strings. I think the default port is 5432.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
This is partly controlled by forcing scripts to use "localhost" instead of hard-coded IPs, in addition to the referring URL.
To expand on this, x10 DB servers appear to use Unix sockets, which is used similar to an IP socket but doesn't itself use any networking facilities. It's simply not possible to connect to a Unix socket from another computer. Sockets exist in the filesystem namespace (e.g. "/var/run/mysqld.sock") but aren't real files; they don't exist on disk (like all the "/dev/*" entries). When a function like 'mysqli_connect' is called with a host like "localhost" (or "localhost:3306"), it automatically uses Unix sockets. If you use a host of "127.0.0.1", the DB connection function will try to create a TCP/IP connection. As it turns out, the x10 DB servers don't bind to a network address (or the address is blocked by a firewall or filter). That is, x10 DB servers don't listen on port 3306 or 5432 or what-have-you, so the connection attempt fails.

The second part of your question asks about the ports, which you may need for php or Perl DBI connect strings. I think the default port is 5432.
It is indeed 5432 for Postgres. The default port for MySQL is 3306. For MSSQL Server it's 1433.
 
Top