CentOS 7.9服务器,一分钟部署完mysql8.0
个人推荐
一/下载mysql脚本和程序包
链接:https://pan.baidu.com/s/1yI4wlYXOBVVitrEdDZPwJQ
提取码:gngj
脚本包含了mysql调优的参数,
二/上传到服务器
[root@10-10-11-193 install]#cd /opt/install
[root@10-10-11-193 install]# ll |grep mysql
-rw-r--r-- 1 root root 393852364 8月 23 2021 mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz
-rw-r--r-- 1 root root 6387 6月 5 13:19 mysql-8.0.13.sh
注:默认安装在/data目录
三/运行脚本
[root@10-10-11-193 install]# bash mysql-8.0.13.sh
===================当前路径为:/opt/install===================
==============================================================
使用完此脚本后,请手动运行source /etc/profile,使用环境变量生效。
==============================================================
脚本安装的目录全部在/data下。
e) mysql_8.0.13安装(端口:3306,账号密码root:).
0) 退出
请输入你的选择(运行e):e
.........................
使用完此脚本后,请手动运行source /etc/profile,使用环境变量生效。
==============================================================
脚本安装的目录全部在/data下。
e) mysql_8.0.13安装(端口:3306,账号密码root:g8-Mqo<rkBso).
0) 退出
请输入你的选择(第一次使用此脚本,必须先运行e):0
[root@10-10-11-193 install]#
注:密码:g8-Mqo<rkBso ).这两个不是
四/登录mysql
[root@10-10-11-193 install]# mysql -uroot -p'g8-Mqo<rkBso'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.13
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
五/修改密码
#修改密码
#8.0 需要先用这条命令
#alter user 'root'@'localhost' identified by '密码';
#CREATE USER 'root'@'%' IDENTIFIED BY '密码';
#GRANT ALL ON *.* TO 'root'@'%';
#ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';
#密码永不过期的
#ALTER USER 'root'@'localhost' IDENTIFIED BY '密码' PASSWORD EXPIRE NEVER;
如有疏漏不妥之处,还请不吝赐教