# 安装依赖
yum update
yum install ncurses-compat-libs
# 下载安装包
# 可以自行选择下载的版本 https://repo.mysql.com/yum/
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-5.7.31-1.el7.x86_64.rpm
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-common-5.7.31-1.el7.x86_64.rpm
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-client-5.7.31-1.el7.x86_64.rpm
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-server-5.7.31-1.el7.x86_64.rpm
# 安装
rpm -Uvh mysql-community-libs-5.7.31-1.el7.x86_64.rpm
rpm -Uvh mysql-community-common-5.7.31-1.el7.x86_64.rpm
rpm -Uvh mysql-community-client-5.7.31-1.el7.x86_64.rpm
rpm -Uvh mysql-community-server-5.7.31-1.el7.x86_64.rpm
# 启动
systemctl start mysqld
# 查找默认密码
grep 'temporary password' /var/log/mysqld.log
# 使用默认密码登录
mysql -u root -p
# 更改默认密码
set password for 'root'@'localhost' = password('XXXXXXXX');
# 更改密码校验等级
set global validate_password_policy=0;
# 创建新用户密码
create user 'chutianshu'@'%' identified by 'XXXXXXXX';
# 授权
GRANT ALL PRIVILEGES ON *.* TO 'chutianshu'@'%' identified by 'XXXXXXXX';
# 使生效
flush privileges;
# 更改端口
vim /etc/my.cnf
# 在文件中加入
port=63306
来源:https://blog.csdn.net/weixin_42109012/article/details/102684153
搜索
标签
study
ab
amap
apache
apahe
awk
aws
bat
centos
CFS
chrome
cmd
cnpm
composer
consul
crontab
css
curl
cygwin
devops
di
docker
docker,docker-compose
ethereum
excel
fiddler
fluentd
framework
front-end
git
gitgui
github
glide
go
golang
gorm
grafana
gzip
ioc
item2
iterm2
javascript
jenkins
jsonp
kafka
laradock
laravel
larval
linux
liunux
log
mac
mac, wi-fi
macos
magento
mariaDB
minikube
mongoDB
msp
mysql
netbeans
nginx
nodejs
nohup
npm
nsq
oracle
php
php-fpm
php7
phpstorm
php扩展
Protobuf
python
redis
scp
server
shell
soap
socket
socket5
sql
sre
ssdb
ssh
ssl
study
sublime
swift
system
td-agent
uml
v2ray
vagrant
vagrnat
vim
vpn
vue
vue.js
webpack
webrtc
websocket
webtatic
windows
windows7
word
wps
xdebug
yarn
yii2
yum
zookeeper
世界国家
互联网
以太坊
分类
前端
小程序
打印机
排序算法
搞笑
权限
粤语
缓存
网络
虚拟机
视频
设计模式
项目管理
热门文章
友情链接