Posts

C, SQL Server, and mysqlclient — Program can't connect using mysql_real_connect() to local DB

Image
1 I am trying to troubleshoot a C program that connects to a local SQL database and then runs a series of commands. Should be SQL Coding 101... but I'm missing something fundamental. I'm working in a Linux container, which supports both the SQL server and is where my C program runs. Some basics: Here's the Linux version: root@1234567890:/home/me# uname -mrs Linux 4.4.0-64-generic x86_64 root@1234567890:/home/me# I have my SQL server running, installed from the instructions here. The service is up, and I can manually query it with SQLCMD: root@1234567890:/home/me# root@1234567890:/home/me# ps -ef | grep sql root 1 0 0 15:45 ? 00:00:00 /opt/mssql/bin/sqlservr root 8 1 0 15:45 ? 00:01:25 /opt/mssql/bin/sqlservr root 13988 13639 0 18:38 pts/2 00:00:00 grep --color=auto sql root@1234567890:/home/me# root@1234567890:/home/me# root@1234567890:/home/me# /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Password01' 1> SELECT @@servername; 2> go ---------...