Installing ubuntu-14.04 in mysql-5.6.21 Systems
1. Preparations before installing mysql (1) download mysql-5.6.21.tar.gz (2), tar-zxvf mysql-5.6.21-tar.gz will generate a folder for the mysql-5.6.21 (3)、download compressed package cmake-2.8.10.2.tar.gz unzip tar-zxvf cmake-2.8.10.2.tar.gz (4) create the directory mkdir-p/home/zxz/cmake-builder (5) on the current layer and configure the installation directory. /configure -- prefix =/home/serverA/cmake-builder (6), enter the cmake-builder directory, and execute the make and make install commands cd cmake-buildermakemake install (7) install and compile MySQL source code library sudo apt-get install cmakesudo aptitude install bisonsudo apt-get install build-essential libncurses5-dev 2. preparations before security and directory settings $ sudo groupadd mysql $ sudouseradd-gmysqlmysql $ sudomkdir-p/var/mysql/data/$ sudomkdir-p/var /mysql/log/$ sudo mkdir/tmp/mysql. sock 3. use cmaktar-zxvf mysql-5.6.21.tar.gzcd mysql-5.6.21sudo cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-DMYSQL_UNIX_ADDR =/tmp/mysql. sock \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci \-DENABLED_LOCAL_INFILE = 1-DMYSQL_DATADIR =/var/mysql/data \ 4. install MySQL $ sudo make $ sudomakeinstall 5. configure MySQLsudo chmod + w/usr/local/mysqlsudochown-R mysql: mysql/usr/local/mysqlsudochown-R mysql: mysql/var/mysql/sudoln-s/usr/local/mysql/lib/libmysqlclient. so.18/usr/lib/libmysqlclient. so.18sudocp support-files/my-default.cnf/var/mysql/my. cnfsudocp support-files/mysql. server/etc/init. d/mysqldsudocp support-files/my-default.cnf/etc/my. cnfsudochown-Rmysql: mysql * 6. initialize and install sudo/usr/local/MySQL/scripts/mysql_install_db \ -- defaults-file =/var/mysql/my. cnf \ -- basedir =/usr/local/mysql \ -- datadir =/var/mysql/data \ -- user = mysql 6. start MySQsudo service mysqld start