Ubuntu12.04. link to MySQL
1. There is no MySQL database after installation. First, we need to install the MySQL database:
Sudo apt-Get install mysql-server-5.1
Automatically, MySQL is installed (including server and client ).
2. Use C Language To operate MySQL, We need to install the MySQL C Language Development Kit:
Apt-Get install libncurses5-dev
Now you can use the C language to operate MySQL Databases!
Note: Program To add the header file: # include <MySQL/MySQL. h>
Do not forget to connect to the library during compilation: gcc-o a. C-lmysqlclient
3. codeblocks is preferred in the Integrated C Language Development Environment (IDE) and codeblocks is installed:
Sudo apt-Get install codeblocks
Configuration
1. Install MySQL and development environment: APT-Get install mysql-server; Apt-Get install libmysqlclient16-dev.
2. Configure code: blocks: settings-> compiler and debuger-> linker seting-> click "add"/usr/lib/libmysqlclient in link libraryl. so "; settings-> compiler and debuger-> Search directeries-> Add"/usr/include/MySQL "to compiler ".
In this way, you can develop it.