From: brian Date: March 13 1999 2:15am Subject: C API List-Archive: http://lists.mysql.com/mysql/129 Message-Id: <36E9CA53.E0EE522C@email.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Friends, I run RedHat Linux 5.1. I have installed MySQL Server, Client and Devel on the same machine. The following C++ code #include <./mysql/mysql.h> #include #include MYSQL a_mysql; void main(void) { if(!mysql_real_connect(&a_mysql, "localhost", "user", "password", "test", 0, 0, 0)) { cout << mysql_error(&a_mysql) << endl << endl; exit(0); } cout << "Everything went OK!!!" << endl << endl; } with the following compile g++ sqltest.cpp /usr/lib/mysql/libmysqlclient.a -osqltest (the suggested "g++ -I/path_to_mysql/include/mysql -L/path_to_mysql/lib/mysql myprogram.c -lmysqlclient" gives a message that it cannot find mysqlclient) will run and give the following error message: Can't connect to MySQL server on localhost (111) I have also tried "" for the hostname as well as 127.0.0.1 and the machines alias all with the same result. I can log into mysql from the command line with: mysql -u root -p and mess around just fine. Any advice would be appreciated. Thanks, Brian