menu jfatty
search self_improvement
目录

云服务器Centos8 安装 MySql5.7.28

jfatty
jfatty 2020年11月13日  ·  阅读 1,802

1.下载安装包

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar

2.解压

tar -xvf mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar

3.安装numactl

yum -y install numactl

4.安装mysql

rpm -ivh mysql-community-common-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.28-1.el7.x86_64.rpm

5.启动服务

systemctl start mysqld.service    启动mysql
systemctl status mysqld.service  查看mysql状态
systemctl stop mysqld.service   关闭mysql
查看mysql进程 ps -ef|grep mysql
查看3306端口 netstat -anop|grep 3306

6.登录mysql 获取临时密码

grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p临时密码

7.重设密码

set password for root@localhost=password('123456');

8.授权远程登录

mysql>use mysql;
msyql>update user set user.Host='%' where user.User='root';
mysql>flush privileges;
分类: MySQL
标签: linux mysql