CentOS 7.9服务器,一分钟部署完mysql8.0

CentOS 7.9服务器,一分钟部署完mysql8.0

精选文章moguli202025-05-13 22:41:256A+A-

个人推荐

Mycat2版部署mysql读写分离

Mycat1.6版部署mysql读写分离

Ubuntu22部署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;

如有疏漏不妥之处,还请不吝赐教

点击这里复制本文地址 以上内容由莫古技术网整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!
qrcode

莫古技术网 © All Rights Reserved.  滇ICP备2024046894号-2