Ubuntu12.04 install MySQL

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.