LinuxLowerCLanguage connectionMySQLNot foundMySQL. hSolution
I installed MySQL yesterday. Today I tried to connect to MySQL by using C language and found that the command gcc-I/usr/include/MySQL connect was used. after C-lmysqlclient-O connect, the system prompts that "MySQL. h "file, t_t |.
The reason is actually very simple. Yesterday I only installed two packages, server and client. for normal use, this is enough, but for database development in Linux, you also need to install the devel development kit, and the version of the development kit should be the same as the version of the server and client package that I installed earlier. Otherwise, the installation will fail due to a conflict.
For installation of the server and client packages, see the previous log: detailed steps for Linux (Fedora 9) to uninstall and install MySQL.
Now, we will install the devel package. Note that the version must be consistent:
[Root @ localhost install] # rpm-IVH MySQL-devel-community-5.1.46-1.rhel5.i386.rpm <br/> preparing... ######################################## ### [100%] <br/> 1: mysql-devel-Community ################################### ######## [100%] <br/>
To avoid further problems, I installed the shared component package shared. Haha:
[Root @ localhost install] # rpm-IVH MySQL-shared-community-5.1.46-1.rhel5.i386.rpm <br/> preparing... ######################################## ### [100%] <br/> 1: mysql-shared-Community ################################### ######## [100%] <br/>
After the installation is complete, the compilation is passed. At this time, the "mysql. H" already appears under the/usr/include/MySQL directory. Happy ~