Cent OS 7 Compile and install My SQL 5.7

Source: Internet
Author: User

Yum-y Groupinstall "Development tools"

Yum-y Install Ncurses-devel pcre-devel openssl-devel Bison


Cd/opt

wget https://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

TAR-ZXF boost_1_59_0.tar.gz

Note: Boost is a free third-party C + + library.


wget https://cmake.org/files/v3.7/cmake-3.7.1.tar.gz

TAR-ZXF cmake-3.7.1.tar.gz

CD cmake-3.7.1

./bootstrap

Make

Make install

CMake--version


Groupadd-r MySQL

Useradd-r-m-g mysql-s/sbin/nologin MySQL


Mkdir-pv/data/mysql

Chown-r Mysql:mysql/data/mysql

Ll-d/data/mysql


TAR-ZXF mysql-5.7.10.tar.gz

CD mysql-5.7.10/

CMake. -dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/data/mysql-dsysconfdir=/etc-dwith_innobase_storage_ Engine=1-dwith_archive_storage_engine=1-denabled_local_infile=1-denable_downloads=1-dwith_blackhole_storage_ Engine=1-ddownload_boost=1 -dwith_boost=/opt/boost_1_59_0 -dwith_federated_storage_engine=1-dwith_ Readline=1-dwith_ssl=system-dwith_zlib=system-dwith_libwrap=0-dmysql_unix_addr=/tmp/mysql.sock-ddefault_ Charset=utf8-ddefault_collation=utf8_general_ci

Make

Make install


echo "Export path= $PATH:/usr/local/mysql/bin" >>/etc/profile

Source/etc/profile


Mysqld--initialize--user=mysql--datadir=/data/mysql--basedir=/usr/local/mysql#数据库的初始化, pay attention to Root's initial password

cd/usr/local/mysql/support-files/

CP Mysql.server/etc/init.d/mysqld

Chkconfig--add mysqld

Chkconfig mysqld on

Service mysqld Start


Service Mysqld Stop

Mysqld_safe--skip-grant-tables &#以忽略授权表的方式重启数据库, set root password

mysql> Update Mysql.user Set Authentication_string=password (' abc-123. ') where user= ' root ' and host= ' localhost '; #密码必须在8位以上

mysql> flush Privileges;


Service mysqld Restart


About the error:

1) You must reset your password using the ALTER USER statement before executing this statement. The problem is caused by too simple password setup.

Solve:

mysql> SET PASSWORD = PASSWORD (' abc-123. ');

Mysql> ALTER USER ' root ' @ ' localhost ' PASSWORD EXPIRE never;

mysql> flush Privileges;


This article from "10,000 years too long, seize" blog, please be sure to keep this source http://zengwj1949.blog.51cto.com/10747365/1937350

Cent OS 7 Compile and install My SQL 5.7

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.