Ubuntu 14.10 under MySQL compilation installation

Source: Internet
Author: User

Ubuntu 14.10 under MySQL compilation installation

1. Installation Environment:
Ubuntu Server 14.10
Mysql-5.6.23.tar.gz

2. Install the necessary tools
sudo apt-get install make Bison g++ build-essential libncurses5-dev cmake

3. Add Group user settings install directory permissions
sudo groupadd MySQL
sudo useradd–g mysql mysql–s/bin/false #创建用户mysql并加入到mysql组, does not allow MySQL users to log in directly to the system
sudo mkdir–p/usr/local/mysql #创建Mysql安装目录
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 Getting the source package
Cd/usr/local/src
sudo wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz

4.2 Extracting MySQL Source package
sudo tar–zxvf mysql-5.6.23.tar.gz

5. Compiling 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-dwith_myisam_storage_engine=1-dwith_ Innobase_storage_engine=1-dwith_memory_storage_engine=1-dwith_readline=1-denabled_local_infile=1-dmysql_ Datadir=/usr/local/mysql/data-dmysql_user=mysql-dwith_debug=0


Precautions:
When you recompile, 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 Digital representation with multi-core operation
sudo make install
6. Related configurations
6.1 Configuring Boot Start
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 Common Command Soft links, setting environment variables
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 Initializing 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 the MySQL service and give it a try
Sudo/etc/init.d/mysqld start

8. Create the root user's password after successful startup
Mysqladmin-u Root Password

9. Use after success
Mysql-uroot-p

Comments:
I put the installation path in the/usr/local/mysql, also is the default path, the data is placed under/usr/local/mysql/data/, sock file put to/usr/local/mysql/mysqld.sock
Some of the parameters are as follows: choose as needed.
Cmake_install_prefix: Specifies the installation directory of the MySQL program, default/usr/local/mysql
Default_charset: Specifies the server default character set, default Latin1
Default_collation: Specifies the default proofing rules for the server, default Latin1_general_ci
Enabled_local_infile: Specifies whether to allow load DATA INFILE to be executed locally, by default off
With_comment: Specifying compilation Notes Information
With_xxx_storage_engine: Specifies a storage engine that is statically compiled to MySQL, and the Myisam,merge,member and CSV four engines are compiled to the server by default and do not require special designation.
Without_xxx_storage_engine: Specifying a storage engine that does not compile
Sysconfdir: Initialize parameter file directory
Mysql_datadir: Data Files directory
Mysql_tcp_port: Service port number, default 3306
Mysql_unix_addr:socket file path, default/tmp/mysql.sock

Ubuntu 14.10 under MySQL compilation installation

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.