Centos6.4 detailed tutorial on mysql 8.0.0 compilation and installation, centos6.48.0.0

Source: Internet
Author: User

Centos6.4 detailed tutorial on mysql 8.0.0 compilation and installation, centos6.48.0.0

The example in this article shares with you how to install and configure mysql 8.0.0 compiled by Centos6.4 for your reference. The specific content is as follows:

Operating System Description:CentOS 1, 6.4
Database Version:MySQL 8.0.0

I. Prepare the environment

yum install ncurses-devel -yyum install libaio -yyum install glibc-devel.i686 glibc-devel -yyum install gcc gcc-c++ -y

In addition, the gcc version 4.8 or later is required for MySQL8.0, while centos 6.4 can only be installed to 4.4.7 through yum. Therefore, you must manually install a later version of gcc before installing mysql8.0, here I take gcc-8.8.2 as an example:

wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.gztar xf gcc-4.8.2.tar.gzcd gcc-4.8.2

# Load the dependent packages required for compilation:./contrib/download_prerequisites
. /Configure -- prefix =/usr/local/gcc-4.8.2/-- enable-bootstrap -- enable-threads = posix -- enable-classes ages = c, c ++, objc, obj-c ++
Make & make install

Note: make takes a long time.
After the installation, you must replace the original gcc environment with the new version of gcc. Otherwise, mysql will still use the original gcc during installation:

mv /usr/bin/gcc /usr/bin/gcc447mv /usr/bin/g++ /usr/bin/g++447mv /usr/bin/c++ /usr/bin/c++447mv /usr/bin/cc /usr/bin/cc447
ln -s /usr/local/gcc-4.8.2/bin/gcc /usr/bin/gccln -s /usr/local/gcc-4.8.2/bin/g++ /usr/bin/g++ln -s /usr/local/gcc-4.8.2/bin/c++ /usr/bin/c++ln -s /usr/local/gcc-4.8.2/bin/gcc /usr/bin/cc
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bakln -s /usr/local/gcc-4.8.2/lib64/libstdc++.so.6.0.18 /usr/lib64/libstdc++.so.6

Solve the following problems:

Next,Install the boost Library:

wget -c http://sourceforge.net/projects/ ... oost_1_60_0.tar.bz2 --no-check-certificatetar xf boost_1_60_0.tar.bz2\?r\=\&ts\=1479114685\&use_mirror\=ncucd boost_1_60_0./bootstrap.sh ./b2 stage threading=multi link=shared./b2 install threading=multi link=shared

Ii. Install mysql8.0

# Download and decompress mysql
Wget-c http://dev.mysql.com/get/Downloa... st-8.0.0-dmr.tar.gz
Tar xf mysql-boost-8.0.0-dmr.tar.gz

# Compile and install mysql

cd mysql-8.0.0-dmrcmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \-DMYSQL_DATADIR=/usr/local/mysql/data/ -DSYSCONFDIR=\etc\mysql \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DMYSQL_TCP_PORT=3306 \-DENABLED_LOCAL_INFILE=1 \-DEXTRA_CHARSETS=all \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DWITH_BOOST=/tmp/boost_1_60_0/makemake install

# Add mysql users and groups and configure mysql users' permissions on Database Directories

groupadd mysql useradd -g mysql mysql chown mysql.mysql /usr/local/mysql -R

# Initializing mysql

cd /usr/local/mysqlbin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/bin/mysql_ssl_rsa_setup

# Configuration file

cp ./support-files/my-default.cnf /etc/my.cnf vim /etc/my.cnf[mysqld]datadir=/usr/local/mysql/data/socket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0pid-file=/var/run/mysqld/mysqld.pidlog-error=/var/log/mysqld.log

# Create a process file directory

mkdir /var/run/mysqldchown mysql /var/run/mysqld/ -R

# Setting Environment Variables

echo "export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/sbin" >> /etc/profilesource /etc/profile

# Set the boot script

cd /usr/local/mysqlcp support-files/mysql.server /etc/init.d/mysql.serverchkconfig mysql.server onservice mysql.server start

Highlights: mysql installation tutorials for different versions

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

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.