Overview
Features
Download
Documentation
Community
Add-Ons & Services

Urgent : please ! Acces to a distant Mysql Database ?

A general discussion forum.

Urgent : please ! Acces to a distant Mysql Database ?

Postby fakher » 03 Aug 2009, 10:14

Hello everybody,
I'm asking myself about how to access to a distant mysql database.I dont really understand samples where you find something like that using namefile.db :
Code: Select all
//Session ses(SessionFactory::instance().create(connector, [b]connectionString[/b]));
Session ses("SQLite", "dummy.db");


I need to know how and where i should put database' parameters like : password, user,database name etc.. Should they be put in the connectionString variable ? if yes, how please ?
Should I use something else than Session object ? Thank you, I need an example please ..

fakher,
fakher
 
Posts: 3
Joined: 27 Jul 2009, 16:47

Re: Urgent : please ! Acces to a distant Mysql Database ?

Postby guenter » 06 Aug 2009, 06:38

You specify a connection string, like this:

Code: Select all
Poco::Data::MySQL::Connector::registerConnector();
Poco::Data::Session sess("MySQL", "user=joe;password=s3cr3t;db=mydatabase;compress=true;auto-reconnect=true");
guenter
 
Posts: 1091
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Urgent : please ! Acces to a distant Mysql Database ?

Postby fakher » 27 Aug 2009, 11:34

Thank you, but how do you specify the host parameter in this string ?
fakher
 
Posts: 3
Joined: 27 Jul 2009, 16:47

Re: Urgent : please ! Acces to a distant Mysql Database ?

Postby guenter » 31 Aug 2009, 19:59

"host=localhost;user=joe;password=s3cr3t;db=mydatabase;compress=true;auto-reconnect=true"
guenter
 
Posts: 1091
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest