HOME       >>       Programming

Database With Mysql++ getting mySQL++ to work with trap17


Hi, I'm trying to build an online game and figured the easiest way to do the server list would be to make a mySQL database for it; however, I use the con() command on the IP i get from pinging my website and I always get an abnormal program termination; however, it will work with the mySQL on my own machine.

The code is below:

#include <iostream>#include <iomanip>#include <mysql++>#include "pass.h"//holds my password (i program at school)int main(void){ Connection con("t3jem3_test","","t3jem3_t3jem",pass); Query query = con.query(); query << "SELECT * FROM test"; Result res = query.store(); Result::iterator i; Row row; for(i = res.begin(); i!=res.end(); i++) { row = *i; cout << setw(6) << row["id"] << setw(10) << row["sname"] << endl; } ::Sleep(5000); return 0;}

This code was taken almost straight out of my multiplayer games programming book.

Other vital info: The site my database is hosted on it right here at Xisto (t3jem.trap17.com).

Any help is appreciated, thanks in advance!


I dont think Xisto allows mysql connections outside its own server. That could be your problem, try running a local mysql server and see if it works for you there.


The correct name for the mysql server is "localhost" and the above post by sonesay is correct in that you will not be able to connect to the Xisto Mysql Server from your own Desktop Command Prompt or from your school. The Mysql server is only available via your Xisto Hosting Account Cpanel, or a script in one of your files on your account.


Alright, thank you very much, at least I know what's wrong now. I will try and figure something out then. Thanks again!


im not sure i think it only alows sub mysql witch is easy to do1. open mysql Query Browser press tools MySQL admin.2.window should pop up press user admin.3. click add user make ID pw .4.then go to schema priv and let it have what u want like acount making and all after done. use it to log in to ur things.if this wont help im not sure


Well, you could always get one of these free MySQL hosting solutions if you wish to have external MySQL. I believe one is http://www.freemysql.net/ could do what you want. They have it configured for other websites to be able to use their MySQL.


Lol If you need help PM me, unless you have figured the problem out already


I suggest using php to create a secure backend that your game can connect to and send and load data from. This way you shouldn't have any issues with permissions.


Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.