Project

General

Profile

Connecting to remote mysql without unix socket

Added by moni S 1 day ago

I am using mysql on docker container listening on localhost 3306. The default uses /var/run/mysqld/mysqld.sock I believe.

I wonder how to connect using tcp in wtc++ ? Empty string doesn't work either as below

        Wt::Dbo::backend::MySQL *sqldb = new Wt::Dbo::backend::MySQL("blogdb", "root", "mypass", "localhost", 3306, "", -1);

Thank you


Replies (1)

RE: Connecting to remote mysql without unix socket - Added by moni S about 18 hours ago

works with ip address. thanks.

Wt::Dbo::backend::MySQL *sqldb = new Wt::Dbo::backend::MySQL("blogdb", "root", "mypass", "127.0.0.1", 3306, "", -1);
    (1-1/1)