Install MySQL server and client
$ Sudo apt-get install mysql-server mysql-client
Install MySQL graphical Management
$ Sudo apt-get install mysql-workbench
To access the MySQL database using C language, you must also install the corresponding development kit
$ Sudo apt-get install libmysqlclient-dev
The C program for compiling and accessing the mysql database must display the directory where the specified development header file and library file are located. You must also link the corresponding library file.
$ Gcc-I/usr/include/mysql test. c-L/usr/lib/mysql-lmysqlclient-o test
If you want to access the MySQL database in C, you need to set character sets in the code to support Chinese characters.
Int mysql set_chararcter_set (MYSQL * mysql, char * csname); // set csname to "utf8" to support Chinese characters.
Returned value: 0 indicates successful; otherwise, the error is returned.