Mysql Connection

Status
Not open for further replies.

keaysma29

New Member
Messages
3
Reaction score
0
Points
0
This has probably been asked, but I couldnt find the answer:
I have got a free host ngsh.x10.mx, and I tried to connect to this adress from my MYSQL Worbench (5.2). I just changes the adress from localhost to the adress, but it just gave me "error: 2" any help, thank you in advance.
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
This has probably been asked, but I couldnt find the answer:
I have got a free host ngsh.x10.mx, and I tried to connect to this adress from my MYSQL Worbench (5.2). I just changes the adress from localhost to the adress, but it just gave me "error: 2" any help, thank you in advance.

For security reasons the Remote MySQL is disabled on x10 servers. You can't connect to MySQL from outside.

The scripts on your account can access the MySQL using Hostname as localhost.
 

keaysma29

New Member
Messages
3
Reaction score
0
Points
0
S owhat you are saying, is that you cannot technically "host" anything, this means that just using localhost is the samething....
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
S owhat you are saying, is that you cannot technically "host" anything, this means that just using localhost is the samething....

Can host anything valid(which follows TOS) but can only accessed locally by the scripts. That means you can't access the MySQL directly from outside. You can access the MySQL from inside(Files on your hosting account).
 
Last edited:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
I should also point out that PHPMyAdmin is installed in cPanel to assist with the management of databases on the account; since PHPMyAdmin is running on the server itself, it'll still work for editing database info.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
And there is nothing against the rules about providing a PHP-based web API to the database from your hosting account (provided that you have at least one web page that uses the same API, say as a set of AJAX calls). You would still be subject to the same resource restrictions as any ordinary website on your hosting plans, but translating a SQL query/response to and from JSON or a similar, minimal bit of structured text isn't terribly difficult. Binaries would have to be base64-encoded, of course, and you'd want to include some kind of type indication for things that look like numbers (text, floats or exact decimal representations, etc.). The resource cost can be very low, particularly if you use SPROCs -- but having an API with a restricted vocabulary is a whole lot safer than direct DB access in any case. If it's for a desktop app, you can go the whole SOAP route as well.

Just remember that you need a corresponding web UI on your site to make it legitimate according to the terms and policies here. It's a good idea anyway, in case you need to access or manipulate data using a foreign machine.
 

keaysma29

New Member
Messages
3
Reaction score
0
Points
0
:confused:essellar, I am goin to say it, "what?"
1. I clearly need to know more about this, I just dev games. This is the first time I have ever worked with mysql.
2. My basic goal is to have a db that allows users to save and load coordinates for thier place on an online game, I have this working for localhost.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
If the online game is on your site, then you'd still use localhost -- it'll just be a different localhost (the server rather than your own machine). If the game is hosted elsewhere, you'd probably be breaking the ToS/AUP using x10Hosting just for the database.

But to explain what I was saying: a web API is a service that you create. Instead of your users interacting directly with the database, they make a request to a PHP script, and that script talks to the database and returns the results, usually as some kind of structured text (XML or JavaScript Object Notation normally, but there are other less common structures as well) rather than as a web page. You can send the script something that looks an awful lot like a SQL query, but then your script pulls it apart and makes sure that everything it's asking for is something you allow. With raw access to the DB, you are allowing users to drop or alter tables and databases, read and write rows they shouldn't have access to, and so on. If they have to go through your script to get there, you can enforce permissions without creating a new DB user for every application user. (And user-based permissions in MySQL aren't very granular.)

SOAP is a web service protocol that rides on HTTP. If you were creating a .NET desktop application, it's the easiest way to talk to a remote computer -- you'd just include the web service using an include statement, almost as if you were using COM/OLE.
 
Status
Not open for further replies.
Top