dbTalk Databases Forums  

Change mysql server and username in simple ?

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Change mysql server and username in simple ? in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Gale
 
Posts: n/a

Default Change mysql server and username in simple ? - 03-11-2005 , 12:47 AM






Hello,

I am trying to change the host, username and password of the simple1
example.

In the file simple1.cpp:

--snip--
// Connect to the sample database
mysqlpp::Connection con(mysqlpp::use_exceptions);

if (!connect_to_db(argc, argv, con)) {
return 1;
}
--snip

I tried adding:

--snip--
// Connect to the sample database
mysqlpp::Connection con(mysqlpp::use_exceptions);

con.connect("mysql_cpp_data","192.168.0.3","mytest ","mypass");
if (!connect_to_db(argc, argv, con)) {
return 1;
}
--snip--

But it is not working ... I have tried a few variations but nothing
When I run ./simple1 I receive:
Error: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)

Michael.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Michael Gale
 
Posts: n/a

Default Re: Change mysql server and username in simple ? - 03-11-2005 , 01:02 AM







Nevermind ...

Michael.


Michael Gale wrote:
Quote:
Hello,

I am trying to change the host, username and password of the simple1
example.

In the file simple1.cpp:

--snip--
// Connect to the sample database
mysqlpp::Connection con(mysqlpp::use_exceptions);

if (!connect_to_db(argc, argv, con)) {
return 1;
}
--snip

I tried adding:

--snip--
// Connect to the sample database
mysqlpp::Connection con(mysqlpp::use_exceptions);

con.connect("mysql_cpp_data","192.168.0.3","mytest ","mypass");
if (!connect_to_db(argc, argv, con)) {
return 1;
}
--snip--

But it is not working ... I have tried a few variations but nothing
When I run ./simple1 I receive:
Error: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)

Michael.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Warren Young
 
Posts: n/a

Default Re: Change mysql server and username in simple ? - 03-11-2005 , 01:02 AM



Michael Gale wrote:

Quote:
I am trying to change the host, username and password of the simple1
example.
Read examples/README to find out why you don't need to do this.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.