Skip navigation links

MySQL Forums :: Connector/C (libmysql) :: mysql_real_connect() and options files


Advanced Search

Re: mysql_real_connect() and options files
Posted by: Sebastien FLAESCH ()
Date: December 19, 2011 10:54AM

I just had a look at the source code (sql-common/client.c) ... and the manual.

Maybe I have misunderstood how the mysql_real_connect() works... It appears that you have to define the options file with mysql_options(), to force the client to read from an option file. I thought it was done my default, trying to read from ~/.my.cnf, /etc/my.cnf, $MYSQL_HOME/my.cnf, etc.

In my previous configuration, I have use the default UNIX socket /tmp/mysql.sock and my libmysqlclient application could connect because it was using that default socket file name too...

Can someone confirm please?

Seb

Options: ReplyQuote


Subject Views Written By Posted
mysql_real_connect() and options files 1837 Sebastien FLAESCH 12/15/2011 03:49AM
Re: mysql_real_connect() and options files 1370 Sebastien FLAESCH 12/19/2011 10:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.