C connectivity with mysql


 
Thread Tools Search this Thread
Top Forums Programming C connectivity with mysql
# 1  
Old 01-21-2013
C connectivity with mysql

I want to connect c with mysql database. want to do all the database transaction. i want some tutorial....
# 2  
Old 01-21-2013
MySQL C API programming tutorial provides a tutorial with worked examples
# 3  
Old 01-21-2013
No i already worked with this. Here the examples are not working.
# 4  
Old 01-21-2013
When you say they are not working, are they compiling and linking (ld $executable) as expected?
# 5  
Old 01-21-2013
"not working" is a useless description.

In what way are they not working?
# 6  
Old 01-22-2013
I am compiling in the same way it is described:

Code:
gcc mysql.c -o mysql `mysql_config --cflags --libs`

during compilation I am getting following error:

Code:
fatal error: mysql.h: No such file or directory

compilation terminated

Last edited by Scott; 01-22-2013 at 05:51 AM.. Reason: Code tags, please...
# 7  
Old 01-22-2013
Try this:
Code:
mysql_config --cflags --libs --include

If it still doesn't work, you may not actually have the mysql headers installed, and no number of tutorials will be able to help you until you do.

How to install them depends on your system; what is it?
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

MySQL Daemon failed to start - no mysql.sock file

After doing a yum install mysql mysql-server on Fedora 14 I wasn't able to fully install the packages correctly. It installed MySQL 5.1. I was getting the following error when running the: mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)... (3 Replies)
Discussion started by: jastanle84
3 Replies

2. IP Networking

Connectivity check.

How to check connectivity with an external server if I know the IP. Please note traceroute is not working for me, as it is saying command not found. (6 Replies)
Discussion started by: nixhead
6 Replies

3. Red Hat

MySQL conflicts with mysql-3.23.58-16.RHEL3.1

I am tring to install mysql 5.0 on redhat linux3. In this server mysql 3 is already installed and hence while I install mysql 5 it gives the following error. How I can install mysql 5 with out affect previous installation? bash-2.05b# rpm -i MySQL-server-community-5.0.41-0.rhel3.i386.rpm... (2 Replies)
Discussion started by: johnveslin
2 Replies

4. UNIX for Advanced & Expert Users

mysql would not start: missing mysql.sock

I recently installed mysql-standard-5.0.21-solaris9-sparc-64bit.pkg on a Solaris 9 machine (SunOS 5.9 Generic_118558-19 sun4u sparc SUNW,Ultra-250). The package installation went very smooth, however, starting mysql is a different story. I get the message below everytime I try to start mysql: #... (2 Replies)
Discussion started by: xnightcrawl
2 Replies

5. UNIX for Advanced & Expert Users

MySQL problem >> missing mysql.sock

MySQL on my server is down.... I figured out that the mysqld process isn't running. When I try to run it, it says it can't find mysql.sock Any suggestions? Here's what I can't do: can't be root don't have physical access (do stuff via SSH) reinstall MySQL (need to keep the current MySQL... (8 Replies)
Discussion started by: _hp_
8 Replies
Login or Register to Ask a Question