Re: [Cppcms-users] cppdb::session: change from Unix socket to remote connection.
Brought to you by:
artyom-beilis
From: Richard S. <ri...@sz...> - 2017-04-10 22:34:38
|
Hi Nazim, thanks for the quick reply and your pointers. Just for reference, I got it working with: sql("mysql:opt_protocol=1;host=localhost;port=3306;database=db;user=user;password='password';@module=./libcppdb_mysql.so"); The prefix mysql_ gets removed from the name and the integer value for the enum element MYSQL_PROTOCOL_TCP is 1 (second in the enum). Kind regards, Richard Szibele On 11/04/17 00:19, Nazım Can Bedir wrote: > > Hello, > > According to > https://dev.mysql.com/doc/refman/5.5/en/mysql-options.html, this may work; > > cppdb::session > sql("mysql:protocol=socket;host=localhost;port=3306;database=db;user=user;password='password';@module=./libcppdb_mysql.so"); > > Regards, > Nazim Can. > > On 11/04/17 00:46, Richard Szibele wrote: >> Hello, >> >> when executing: >> >> cppdb::session >> sql("mysql:host=localhost;port=3306;database=db;user=user;password='password';@module=./libcppdb_mysql.so"); >> >> I get the following exception: >> >> what(): cppdb::mysql::Can't connect to local MySQL server through >> socket '/run/mysqld/mysqld.sock' (2 "No such file or directory") >> >> How can I specify cppdb::session to use the host and port for my MySQL >> server and not Unix sockets? >> >> Perhaps I am missing something, but it does not seem clear from the >> documentation at: >> http://cppcms.com/sql/cppdb/connstr.html >> and >> http://cppcms.com/sql/cppdb/mysql.html >> >> Kind regards, >> Richard Szibele >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org!http://sdm.link/slashdot >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |