Compile and install the Ubuntu-12.04.2 on the MySQL-5.6.10 [Installation notes] the following installation involves a few issues that need to be explained in advance: 1. all downloaded files are saved in the/usr/local/src/directory. mysql will run as a mysql user and will be added to the service for automatic start 3. mysql will be installed in the/usr/local/mysql/directory 4. mysql uses the utf8 character set by default. mysql Data and log files are stored in the/var/mysql/directory 6. the mysql configuration file is saved in/var/mysql/my. cnf 1: download and install MySQL source code library sudo apt-get install build-essential libncurses5-dev cmake 2: download and unzip the MySQL source package cd/usr/local/src/sudo wget-O mysql-5.6.10.tar.gz http://www.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/sudo Tar-zxvf mysql-5.6.10.tar.gz sudo/usr/sbin/groupadd mysqlsudo/usr/sbin/useradd-g mysql sudo mkdir-p/var/mysql/ data/sudo mkdir-p/var/mysql/log/sudo chmod 777/var/mysql/data 3: use cmake to generate the Installation File cd mysql-5.6.10sudo cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_UNIX_ADDR =/tmp/mysql. sock-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-DWITH_EXTRA _ CHARSETS: STRING = utf8, gbk-encoding = 1-DWITH_INNOBASE_STORAGE_ENGINE = 1-DWITH_READLINE = 1-DENABLED_LOCAL_INFILE = 1-DMYSQL_DATADIR =/var/mysql/data 4: install MySQLsudo makesudo make install sudo chmod + w/usr/local/mysqlsudo chown-R mysql: mysql/usr/local/mysqlsudo chown-R mysql: mysql/var/mysql/sudo ln-s/usr/local/mysql/lib/libmysqlclient. so.18/usr/lib/libmysqlclient. so.18 sudo c My-default.cnf/var/mysql/my. cnf (Note: my-large.cnf for 1g memory around the server, you can choose according to their own configuration of my-large.cnf or my-huge.cnf and other different configurations) sudo cp mysql. server/etc/init. d/mysqld 4. configure to start MySQL 5.6.10 1. if necessary, modify the mysql configuration first. cnfvi/var/mysql/my. cnf 2. mysql initialization and installation/usr/local/mysql/scripts/mysql_install_db \ -- defaults-file =/var/mysql/my. cnf \ -- basedir =/usr/local/mysql \ -- datadir =/var/mysql/data \ -- user = mysql is a line of sudo/usr/local/ Mysql/scripts/mysql_install_db -- defaults-file =/var/mysql/my. cnf -- basedir =/usr/local/mysql -- datadir =/var/mysql/data -- user = mysql 3. add mysql to start sudo chmod + x/etc/init. d/mysqld vi/etc/init. d/mysqld (sudo vim/etc/init. d/mysqld edit this file, find and modify the following variables: basedir =/usr/local/mysqldatadir =/var/mysql/data save and exit sudo chkconfig -- add mysqld ========== ========================================== Error: sudo: chkconfig: No To the command Fixed: sudo apt-get install chkconfig ================================== ========= sudo chkconfig -- level 345 mysqld on ====================== ============================== Error: /sbin/insserv: no such file or directory Fixed: sudo ln-s/usr/lib/insserv/sbin/insserv ================== ===========================/ usr/local/mysql/bin/mysqladmin-u root password new passwordeg ==> sudo/ usr/local/mysql/bin/mysqladmin-u ro Ot password 123456 ============================================ ====== Error: /usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MySQL server through socket '/tmp/mysql. sock '(2) 'check that mysqld is running and that the socket:'/tmp/mysql. sock 'exists! Fixed: (this is because the system has a mysql zombie process, which can be killed or restarted) reboot =================================================== ==== sudo ln-s/usr/local/mysql/bin/mysql/usr/bin/mysql Test: mysql-u root-p 4. start mysqlsudo service mysqld restart // now, the installation is complete