MySQL 5.7.9源码编译安装说明(2)

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,Java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux

Thread model: posix

gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)

[root@mdb01 cmake-3.3.2]#

4) perl

[root@mdb01 cmake-3.3.2]# perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the

GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on

this system using "man perl" or "perldoc perl".  If you have access to the

Internet, point your browser at , the Perl Home Page.

[root@mdb01 cmake-3.3.2]#

5) 其它系统包

ncurses-devel bison

[root@mdb01 Packages]# rpm -ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm

warning: ncurses-devel-5.7-3.20090208.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing...                ########################################### [100%]

1:ncurses-devel          ########################################### [100%]

[root@mdb01 Packages]# rpm -ivh bison-2.4.1-5.el6.x86_64.rpm

warning: bison-2.4.1-5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing...                ########################################### [100%]

1:bison                  ########################################### [100%]

[root@mdb01 Packages]#

3.安装前配置

# Preconfiguration setup

[root@mdb01 soft]# groupadd mysql

[root@mdb01 soft]# useradd -r -g mysql mysql

# Beginning of source-build specific instructions

[root@mdb01 soft]# tar zxvf mysql-5.7.9.tar.gz

[root@mdb01 soft]# cd mysql-5.7.9

4.配置安装项

[root@mdb01 mysql-5.7.9]# cmake \

>    -DCMAKE_INSTALL_PREFIX=/opt/mysql \

>    -DMYSQL_DATADIR=/opt/mysql/data \

>    -DSYSCONFDIR=/etc \

>    -DWITH_MYISAM_STORAGE_ENGINE=1 \

>    -DWITH_INNOBASE_STORAGE_ENGINE=1 \

>    -DWITH_PARTITION_STORAGE_ENGINE=1 \

>    -DMYSQL_UNIX_ADDR=/opt/mysql/mysql.sock \

>    -DMYSQL_TCP_PORT=3306 \

>    -DENABLED_LOCAL_INFILE=1 \

>    -DEXTRA_CHARSETS=all \

>    -DDEFAULT_CHARSET=utf8 \

>    -DDEFAULT_COLLATION=utf8_general_ci

5.编译MySQL

[root@mdb01 mysql-5.7.9]# make

6.安装MySQL

[root@mdb01 mysql-5.7.9]# make install

# End of source-build specific instructions

五、安装后配置

# Postinstallation setup

1.目录权限

shell> cd /opt/mysql

shell> chown -R mysql .

shell> chgrp -R mysql .

2.初始化数据库

shell> bin/mysql_install_db --user=mysql    # Before MySQL 5.7.6

shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and up

执行结果:

[root@mdb01 mysql]# bin/mysqld --initialize --user=mysql

2015-10-29T21:58:57.465483Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2015-10-29T21:58:59.889999Z 0 [Warning] InnoDB: New log files created, LSN=45790

2015-10-29T21:59:00.201432Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7c2f3d5f88b79265c3f0861b76147f16.html