LNMP MySQL Original code compilation

Source: Internet
Author: User


Server2.example.com 172.25.85.2

Enterprise part:

1. Configure MySQL

Yum install httpd php php-mysql mysql-server cmake gcc gcc-c++ ncurses-devel Bison openssl-devel zlib-devel-y
Tar zxf mysql-boost-5.7.11.tar.gz
Yum Update cmake-2.8.12.2-4.el6.x86_64.rpm

Tar zxf mysql-5.7.11.tar.gz

cd/root/mysql-5.7.11

CMake
-dcmake_install_prefix=/usr/local/lnmp/mysql # #安装路径
-dmysql_datadir=/usr/local/lnmp/mysql/data # #数据库存放目录
-dmysql_unix_addr=/usr/local/lnmp/mysql/data/mysql.sock # #Unix Socket file path
-dwith_myisam_storage_engine=1 # #安装 MYISAM Storage Engine
-dwith_innobase_storage_engine=1 # #安装 InnoDB storage Engine
-ddefault_charset=utf8 # #使用 UTF8 characters
-DDEFAULT_COLLATION=UTF8_GENERAL_CI # #校验字符
-dextra_charsets=all # #安装所有扩展字符集
-dwith_boost=boost/boost_1_59_0/# #boost路径

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/85/65/wKiom1eiIQqgmSF0AACmWZLP8sQ352.png-wh_500x0-wm_3 -wmp_4-s_806856772.png "title=" screenshot from 2016-07-20 14-36-02.png "alt=" Wkiom1eiiqqgmsf0aacmwzlp8sq352.png-wh_ "/>



"Note":
RM-FR CMakeCache.txt # #错误解决完毕每次删除 (if Rem-dextra_charsets=allove CMakeCache.txt and rerun CMake are present, simply remove Cmakecache.tx T file)




LSCPU # #检测cpu


"Note":
Compiling MySQL requires a lot of memory space, so before compiling MySQL, 2 CPUs and 3G of memory are allocated to MySQL.
Then assign the 8G virtual partition to MySQL, and the host will change the newly created partition into LVM format:

Fdisk-l # #查看新的虚拟分区,/dev/vdb
FDISK-CU/DEV/VDB # #linux LVM
Pvcreate/dev/vdb1
VGs

Vgextend VOLGROUP/DEV/VDB1
Lvextend-l +8g/dev/volgroup/lv_root
Lvextend-l +2047/dev/volgroup/lv_root
Resize2fs/dev/volgroup/lv_root

Lvs




cd/root/mysql-5.7.11
MAKE-J2 # #时间比较长
Make install



2 setting MySQL information:

Useradd-u 27-g mysql-s/bin/false
Cp/usr/local/lnmp/mysql/support-files/mysql.server/etc/init.d/mysqld
Mv/etc/my.cnf/etc/my.cnf.bak
Cp/usr/local/lnmp/mysql/support-files/my-default.cnf/etc/my.cnf

Cd/usr/local/lnmp/mysql/bin
Vim ~/.bash_profile

Path= $PATH: $HOME/bin:/usr/local/lnmp/mysql/bin

SOURCE ~/.bash_profile

Cd/usr/local/lnmp/mysql
Chown-r Mysql.mysql

Mysqld--initialize--user=mysql # #可以找到mysql的初始密码,--initialize-insecure # #密码为空,--user=mysql # #运行用户--basedir= # #mysq L Basic Catalogue--Datadir= # #mysql数据目录

Cd/usr/local/lnmp/mysql
Chown-r Root.
Chown-r MySQL Data

/etc/init.d/mysqld start
Mysql_secure_installation






LNMP MySQL Original code compilation

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.