Category Archives: MySQL

Fix errors for MySQL


MySQL 5.7.8 remote access with TCP, you may get error like this:

Add following into MySQL config file


MySQL C API programming – Solve garbled Chinese words

The garbled Chinese worlds is caused by the incorrect character setting.



MySQL C API programming – First example

Install the MySQL C development libraries

C program

Compile the code

If everything goes well, you can see the output like this:


MySQL Error: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

After building MySQL from sources on Ubuntu, I got this error:

I checked the directory “/tmp/” there is no “mysql.sock”. After some researches, I found that the problem came from the mysql config file “my.conf”, mine is empty. Just reedit it to solve the problem. Here is a example:


Install WordPress with Nginx on Ubuntu

This documents covers how to install WordPress with Nginx on Ubuntu.

WordPress is an open source web software used to create website based on PHP and MySQL. WordPress is used by more than 22.0% of the top 10 million websites as of August 2013, according to Usage of content management systems for websites.

nginx (engine x) is an open source reverse proxy server for HTTP mail, written by Igor Sysoev. It was used by 21.5% of the top 1 million websites, 29% of the top 100,000 websites, and by 38.5% of the top 1,000 websites according to Usage of web servers broken down by ranking. Continue reading

Building MySQL Native Driver(Mysqlnd) for PHP by phpize

After building PHP with PHP-FPM for Nginx server and building MySQL server. This document shows you how to build Mysqlnd(MySQL Native Driver) .

Mysqlnd is written in C as a PHP extension, so it is unlike the older MySQL client library that was written by MySQL AB(Oracle Corporation) under MySQL license, it is released under the PHP license.

Using Mysqlnd you don’t need to copy the MySQL client library, so this much more convenient for web server without MySQL server.

Using MySQL Native Driver leads to better performance than using MySQL Client, especially when it comes to memory usage, as a PHP extension, the driver uses the PHP memory management, so it is supports the PHP memory limit. Using the MySQL Client Library, each row is stored in memory twice, whereas with the Mysqlnd each row is only stored once in memory. Continue reading

Building MySQL from Sources on Ubuntu

This documentation is going to tell you how to install and configure MySQL 5.6.19 from sources on Ubuntu.

1. Install cmake tools.

2. Download and extract MySQL source codes.
Download page:

3. cmake and install

4. fix errors


CMake Error: your CXX compiler: “CMAKE_CXX_COMPILER-NOTFOUND” was not found.

Warning: Bison executable not found in PATH

Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.

c++: internal compiler error: Killed (program cc1plus):  You need at least 1G RAM. Continue reading