Deepin 15.4/ubuntu 14 Source code compilation installation MySQL-5.6.35

Source: Internet
Author: User
Tags iptables

Under Ubuntu, has been a binary package decompression installation, the details of the reference:

Http://www.cnblogs.com/phpgo/p/5680906.html

Now replace the source code to compile the installation:

#!/bin/bash# Install dependent libraries sudo apt-get-y install make cmake gcc g++ bison OpenSSL libssl-dev libncurses5-dev# Create Data folder sudo mv /fiisoo/mysql/fiisoo/mysql.$ (date "+%y-%m-%d.%s") sudo mkdir-pv/fiisoo/mysql/confsudo mkdir-pv/fiisoo/mysql/ Logsudo mkdir-pv/fiisoo/mysql/tmpsudo mkdir-pv/fiisoo/mysql/data# Create MySQL user and user group #groupadd mysql#useradd-g mysql-s/ Usr/sbin/nologin MySQL # do not let MySQL users log in directly # unzip Mysql-5.6.35cd/usr/local/src/ubuntu-sdk/source2/mysqlsudo RM-RF./mysql-5. 6.35sudo tar-xzvf./mysql-5.6.35.tar.gzcd./mysql-5.6.35sudo mkdir-pv/usr/local/mysql/mysql-5.6# set permissions sudo chown-r php Go:phpgo. /mysql-5.6.35sudo chown-r phpgo:phpgo/usr/local/mysql# build configuration sudo cmake-dcmake_install_prefix=/usr/local/mysql/ Mysql-5.6-dmysql_datadir=/fiisoo/mysql/data-ddefault_charset=utf8-ddefault_collation=utf8_unicode_ci-dwith_ Readline=1-dwith_ssl=system-dwith_embedded_server=1-denabled_local_infile=1-ddefault_collation=utf8_general_ci -dwith_myisam_storage_engine=1-dwith_innobase_storage_engine=1-dwith_debug=0# installing sudo rm-rf./cmakecache.txt # "Note" This step is very important, otherwise always error!!! sudo make && make install# copy configuration file #cp./support-files/my-medium.cnf/etc/my.cnfsudo mv/etc/my.cnf/etc/my.cnf.$ ( Date "+%y-%m-%d.%s") sudo mv/fiisoo/mysql/conf/my.cnf/fiisoo/mysql/conf/my.cnf.$ (date "+%y-%m-%d.%s") sudo \cp-rf/ Usr/local/src/ubuntu-sdk/config/mysql-5.6/my.cnf/fiisoo/mysql/conf/sudo ln-s/fiisoo/mysql/conf/my.cnf/etc/  my.cnf# set permissions sudo chmod-r 755/usr/local/mysql/mysql-5.6sudo chown-r phpgo:phpgo/usr/local/mysql/mysql-5.6sudo chown-r phpgo:phpgo/fiisoo/mysql# Set Boot auto-start # CP./support-files/mysql.server/etc/init.d/mysqld\cp-rf/usr/local/src/ Ubuntu-sdk/config/mysql-5.6/mysqld.init/etc/init.d/mysqldchmod +x/etc/init.d/mysqldchkconfig--add Mysqldchkconfig--level 2345 mysqld on# Add a soft link to MySQL to fit the init script sudo ln-sv/usr/local/mysql/mysql-5.6/bin/mysql/usr/sbi N/mysqlsudo Ln-sv/usr/local/mysql/mysql-5.6/bin/mysqladmin/usr/sbin/mysqladminsudo ln-sv/usr/local/mysql/mysql-5.6/bin/mysqldump/usr/sbin/mysqldump# Initializing database sudo/usr/local/mysql/mysql-5.6/scripts/mysql_install_db--user= Phpgo--basedir=/usr/local/mysql/mysql-5.6--datadir=/fiisoo/mysql/data# start mysqlsudo killall Mysqldsudo Service  mysqld start# Change Root Password # Note: First enter the old password (default is a blank password), and then let you enter a new password #/usr/local/mysql/mysql-5.6/bin/mysqladmin-u root-p password# the port 3306 add to Firewall # vim/etc/sysconfig/iptables# service iptables restart

Reference:

Http://www.111cn.net/sys/Ubuntu/52806.htm

http://95136616.blog.51cto.com/9176786/1846974

Deepin 15.4/ubuntu 14 Source code compilation installation MySQL-5.6.35

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.