centos mysql5.7 二进制包安装
Posted shijiu520
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos mysql5.7 二进制包安装相关的知识,希望对你有一定的参考价值。
此种方式安装非常简单
cd /usr/local
下载安装包
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
解压
tar -zxvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
[[email protected] local]# pwd
/usr/local
[[email protected] local]# mv mysql-5.7.17-linux-glibc2.5-x86_64 mysql
cd mysql
mkdir -p /data/mysql/data
创建mysql 用户
useradd mysql -s /sbin/nologin -M(没有家目录)
chown -R mysql.mysql /data/mysql
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data
提示初始密码:
2017-03-29T15:09:12.116410Z 1 [Note] A temporary password is generated for [email protected]: ew/Wx(<Z>43l
拷贝启动脚本文件
cp support-files/mysql.server /etc/init.d/mysqld
设置开机启动
chkconfig mysqld on
chkconfig --list|grep mysqld
chmod 755 /etc/init.d/mysqld
配置环境变量
echo ‘PATH=/usr/local/mysql/bin/:$PATH‘ >> /etc/profile
. /etc/profile
进入MySQL :
mysql -uroot -p ew/Wx(<Z>43l
修改密码
alter user ‘root‘@‘localhost‘ identified by ‘123456‘;
flush privileges;
grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘;
FLUSH PRIVILEGES;
以上是关于centos mysql5.7 二进制包安装的主要内容,如果未能解决你的问题,请参考以下文章
Centos7.5安装mysql5.7.24二进制包方式部署(主从复制)