mysql_real_connect() and options files
Posted by: Sebastien FLAESCH
Date: December 15, 2011 03:49AM

Hello,

My OS is Debian Squeeze, and I have just upgraded MySQL 5.5.1 to 5.5.19 (in a development environment - not installed with regular Debian package manager)...

I have a C program doing mysql_real_connect() with "no value" parameters for the host/port/socket, and it seems that the function does not read the default [client] settings in the different my.cnf options files..

Package mysql binaries (mysql, mysqladmin) read from the configuration files.

In fact I get the typical localhost connect error:

Can't connect to local MySQL server through socket '/tmp/mysql.sock'

No matter what I put in the [client] section of my ~/.my.cnf, /etc/my.cnf or $MYSQL_HOME/my.cnf files, it's just ignored.

Has something changed since 5.5.1 ?!?!

My code did NOT change, just mysql_init() and then mysql_real_connect() ...

I do NOT use the mysql_options(MYSQL_READ_DEFAULT_FILE,"xxx") way.

Thanks for your help!
Seb

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql_real_connect() and options files
3837
December 15, 2011 03:49AM


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.