MySql 简易安装指南

Posted by WeYunx on January 31, 2019

在 Centos7 系统下使用 yum 命令安装 MySql ,首先先在官网这里查看资源包。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 根据实际情况替换 mysql80-community-release-el7-2.noarch.rpm 为最新版本
wget http://repo.mysql.com/mysql80-community-release-el7-2.noarch.rpm

# 安装
rpm -ivh mysql*.rpm
yum update
yum install mysql-server

# 设置权限
chmod 777 mysqld.log
chown mysql:mysql -R /var/lib/mysql

# 初始化
mysqld --initialize

# 启动
systemctl start mysqld

# 查看初始密码
cat /var/log/mysqld.log | grep password

例:

2019-01-30T12:53:55.670725Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: 22g!lpwRac%t

记录密码 22g!lpwRac%t 进行登录:

1
2
3
4
5
# 登录 MySql,并输入密码
mysql -u root -p

# 修改密码为123
mysql> set password for [email protected] = ‘123’;

未完待续…

本文为[原创]文章,转载请标明出处。
本文链接:https://weyunx.com/2019/01/31/mysql-install/
本文出自微云的技术博客