Ubuntu 13.04 under compilation install MySQL

Source: Internet
Author: User

Installation Environment:

Ubuntu Desktop Edition 13.04

Installation version:

Mysql-5.6.12.tar.gz1.

To install the prerequisite tools:
    1. sudo apt-get install CMake libncurses5-Dev Bison g+ +
2 Add groups and users and install directory permissions
  1. sudo groupadd mysql #添加组
  2. sudo useradd -g MySQL MySQL -s /bin/false #创建用户mysql并加入到mysql组, Do not allow MySQL users to log in directly to the system
  3. sudo mkdir -p /usr/local/MySQL #创建MySQL安装目录
  4. sudo mkdir -p /usr/local/mysql/data #创建MySQL安装目录
  5. sudo chown -R mysql:mysql /usr/local/mysql/Data # Set MySQL database directory permissions
3 Compiling and installing Ysql
    1. CD /usr/local/src
    2. sudo wget http://mysql.mirror.kangaroot.net/downloads/mysql-5.6/mysql-5.6.12.tar.gz
3.1 Extracting MySQL
    1. sudo tar -zxvf mysql-5.6. 12.tar. GZ
3.2 Configuration Compilation
  1. 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=< Span class= "lit" >1 -denabled_local_infile =1 -dmysql_datadir< Span class= "pun" >=/usr/local/mysql/data -dmysql_user= mysql -dwith_debug=0< Span class= "PLN" >
  2. sudo make -J4 #-j Digital representation with multi-core operation
  3. sudo make install
4. Related Settings 4.1 Configure boot start
  1. sudo cp ./Support-files/My-default. CNF /etc/my. Cnf
  2. sudo cp ./Support-files/mysql. Server /etc/init. D/mysqld #把Mysql加入系统启动
  3. sudo chmod 755 /etc/init. D/mysqld
  4. sudo chkconfig mysqld on
4.2 Common Command Soft links
  1. sudo ln -s /usr/local/mysql/bin/mysql /usr/ bin
  2. sudo ln -s /usr/local/mysql/bin/mysqladmin /usr/ bin
4.3 Initializing the database
  1. Sudo/Usr/local/mysql/ scripts/mysql_install_db -- basedir=/usr/local/< Span class= "PLN" >mysql --datadir=/usr/< Span class= "KWD" >local/mysql/data --skip-name- resolve --user=mysql
4.4 Modifying a configuration file
    1. sudo vi /etc/my. CNF
Add end of File:
    1. #增加默认存储类型和去掉反向解析
    2. Default-storage-engine=MyISAM
    3. Skip-name-resolve
If the server quit without updating PID file appears, follow the Create PID and Change permissions 775

Ubuntu 13.04 under compilation install MySQL

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.