1. installation environment: UbuntuServer14.10MySQL-5.6.23.tar.gz 2. install essential tools sudoapt-getinstallmakebisong ++ build-essentiallibncurses5-devcmake3. Add combine user set installation directory permissions sudogroupaddmysqlsudouseradd & ndash; gmysqlm
1. installation environment:
Ubuntu Server 14.10
MySQL-5.6.23.tar.gz
2. install necessary tools
Sudo apt-get install make bison g ++ build-essential libncurses5-dev cmake
3. Add a combined user to set the installation directory permission
Sudo groupadd mysql
Sudo useradd-g mysql-s/bin/false # create a user mysql and add it to the mysql group. mysql users are not allowed to log on to the system directly.
Sudo mkdir-p/usr/local/mysql # create the Mysql installation directory
Sudo mkdir-p/usr/local/mysql/data
Sudo mkdir-p/usr/local/mysql/log
Sudo chown-R mysql: mysql/usr/local/mysql/data
Sudo chown-R mysql: mysql/usr/local/mysql
4. Compile and install mysql
4.1 get source code package
Cd/usr/local/src
Sudo wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz
4.2 decompress the mysql source code package
Sudo tar-zxvf mysql-5.6.23.tar.gz
5. Compile the configuration
Cd mysql-5.6.23
Sudo cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DSYSCONFDIR =/etc-DMYSQL_UNIX_ADDR =/tmp/mysql. sock-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-DEXTRA_CHARSETS = all-rows = 1-rows = 1-rows = 1-DWITH_READLINE = 1-rows = 1-rows =/usr/local /mysql/data-DMYSQL_USER = mysql-DWITH_DEBUG = 0
Note:
During re-compilation, you need to clear the old object file and cache information.
# Make clean
# Rm-f CMakeCache.txt
# Rm-rf/etc/my. cnf
Sudo make-j4 #-j: Run with multiple cores
Sudo make install
6. Related Configuration
6.1 configure startup
Sudo chmod + w/usr/local/mysql
Sudo cp./support-files/my-default.cnf/etc/my. cnf
Sudo cp./support-files/mysql. server/etc/init. d/mysqld
Sudo chmod 755/etc/init. d/mysqld
6.2 set environment variables for soft connections with Common commands
Sudo ln-s/usr/local/mysql/lib/libmysqlclient. so.18/usr/lib/libmysqlclient. so.18
Sudo ln-s/usr/local/mysql/bin/mysql/usr/bin
Sudo ln-s/usr/local/mysql/bin/mysqladmin/usr/bin
6.3 initialize the database
Sudo/usr/local/mysql/scripts/mysql_install_db -- defaults-file =/etc/my. cnf -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data -- user = mysql
7. Start mysql service for a try
Sudo/etc/init. d/mysqld start
8. Create a password for the root user after the startup is successful.
Mysqladmin-u root password
9. Use
Mysql-uroot-p
Note:
I put the installation path under/usr/local/mysql, that is, the default path, and data under/usr/local/mysql/data, put the sock file in/usr/local/mysql/mysqld. sock
Some parameters are as follows: select as needed.
CMAKE_INSTALL_PREFIX: Specifies the installation directory of the MySQL program. The default value is/usr/local/mysql.
DEFAULT_CHARSET: Specifies the default Character Set of the server. The default value is latin1.
DEFAULT_COLLATION: Specifies the default server verification rules. The default value is latin1_general_ci.
ENABLED_LOCAL_INFILE: Specifies whether local load data infile execution is allowed. The default value is OFF.
WITH_COMMENT: Specifies the compilation remarks.
WITH_xxx_STORAGE_ENGINE: it specifies the storage engine for static compilation to mysql. By default, four engines, MyISAM, MERGE, MEMBER, and CSV, are compiled to the server, and do not need to be specified.
WITHOUT_xxx_STORAGE_ENGINE: Specifies the storage engine that is not compiled.
SYSCONFDIR: directory of the initialization parameter file
MYSQL_DATADIR: data file directory
MYSQL_TCP_PORT: Service port number. The default value is 3306.
MYSQL_UNIX_ADDR: socket file path. Default Value:/tmp/mysql. sock
-------------------------------------- Split line --------------------------------------
MySQL5.7.3.0 installation configuration graphic tutorial http://www.linuxidc.com/Linux/2014-10/108397.htm
Install MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scanning version PDF http://www.linuxidc.com/Linux/2014-03/98821.htm
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm
Build a MySQL Master/Slave server http://www.linuxidc.com/Linux/2014-05/101599.htm in Ubuntu 14.04
Ubuntu 12.04 LTS build highly available distributed MySQL cluster http://www.linuxidc.com/Linux/2013-11/93019.htm
Install MySQL5.6 and Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm in Ubuntu 12.04
MySQL-5.5.38 general binary mounting http://www.linuxidc.com/Linux/2014-07/104509.htm
-------------------------------------- Split line --------------------------------------
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-05/117653.htm