mysql5.7.20安装

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql5.7.20安装相关的知识,希望对你有一定的参考价值。

rpm -qa | grep mysql
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
cd /root
wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
mkdir -p /usr/local/boost
tar xf boost_1_59_0.tar.gz(5.7才安装)
mv boost_1_59_0 /usr/local/boost/

tar xf mysql-5.7.20.tar.gz
cd mysql-5.7.20
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_BOOST=/usr/local/boost -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make
make install

groupadd mysql
useradd -g mysql -s /sbin/nologin -M mysql
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql
bin/mysqld --initialize-insecure --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 35 mysqld on

cp /etc/my.cnf /etc/my.cnf.bak
vim /etc/profile.d/mysqld.sh
. /etc/profile.d/mysqld.sh
mkdir /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
vim /etc/my.cnf
service mysqld start
mysql -u root
mysql> SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘newpass‘);

以上是关于mysql5.7.20安装的主要内容,如果未能解决你的问题,请参考以下文章

Mysql5.7.20 On Windows安装指导

Mysql5.7.20安装文档

安装mysql5.7.20

mysql5.7.20安装

安装mysql5.7.20

win10下MySQL5.7.20解压版安装步骤