当前位置:网站首页>linux安装mysql8参考指引
linux安装mysql8参考指引
2022-07-30 06:12:00 【weixin_44953227】
1、在 /use/local下 创建mysql文件夹 执行命令 mkdir mysql
2、切换到/use/local/mysql文件夹,下载mysql8 执行命令
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-i686.tar.gz
3、解压mysql8 执行命令 tar -zxvf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz
4、得到mysql-8.0.11-linux-glibc2.12-x86_64重命名为mysql8.0
执行命令 mv mysql-8.0.11-linux-glibc2.12-x86_64 mysql8.0
5、创建数据存储文件夹data 执行命令 mkdir data
6、创建用户组以及用户执行命令
groupadd mysql
useradd -g mysql mysql
7、授权用户 执行命令 chown -R mysql.mysql /usr/local/mysql/mysql8.0
8、初始化基础信息 执行命令./bin/mysqld --user=mysql --basedir=/usr/local/mysql/mysql8.0/ --datadir=/usr/local/mysql/mysql8.0/data/ --initialize 并得到初始密码 vsZ-l5.GI=le
9、Mysql配置(按照自己的文件路径配置,关于其他配置,可自行搜索,若有【mysql-safe】的配置,可以先注释掉)
执行命令 vi /etc/my.cnf 编辑配置文件
修改或者添加配置项
basedir=/usr/local/mysql/mysql8.0/
datadir=/usr/local/mysql/mysql8.0/data/
socket=/tmp/mysql.sock
character-set-server=UTF8MB4
10、添加服务到系统 执行命令 cp -a ./support-files/mysql.server /etc/init.d/mysql
11、授权以及添加服务执行命令
chmod +x /etc/init.d/mysql
chkconfig --add mysql
12、检查服务是否生效执行命令 chkconfig --list mysql
13、启动服务 执行命令 mysql service mysql start
14、查看启动状态 执行命令 service mysql status
15、将mysql命令添加到服务执行命令 ln -s /usr/local/mysql/mysql8.0/bin/mysql /usr/bin
16、登陆Mysql执行命令mysql -uroot -p 回车 输入上面得到的随机初始化密码
17、修改密码 ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘新密码’;
18、执行命令 flush privileges;使密码生效
至此,mysql8安装完成
err1、安装过程中出现的情况
下载mysql8出现 -bash: wget: 未找到命令 报错
执行命令 yum -y install wget
若客户端远程链接不上mysql服务,
err2、检查是否有用户user为root 的host为%(代表允许远程任意主机连接) 执行命令 select host,user,authentication_string from mysql.user;
检查防火墙是否关闭 执行命令 firewall cmd --state
若没关闭,请关闭 systemctl stop firewalld
边栏推荐
- [GO Language Basics] 1. Why do I want to learn Golang and get started with GO language
- Keil编译大小和存储说明
- How to calculate the daily cumulative capital flow one by one in real time
- 便携小风扇PD取电芯片
- “AI教练”请进家,家庭智能健身蓬勃发展
- Ali two sides: Sentinel vs Hystrix comparison, how to choose?
- IDEA搜索插件无结果一直转圈圈的解决办法
- uniapp中canvas与v-if更“配”
- When does MySQL use table locks and when does it use row locks?
- go : go gin返回JSON数据
猜你喜欢
预测人们对你的第一印象,“AI颜狗”的诞生
Electron之初出茅庐——搭建环境并运行第一个程序
New breakthrough in artificial muscle smart materials
The introduction of AI meta-learning into neuroscience, the medical effect is expected to improve accurately
How does Redis prevent oversold and inventory deduction operations?
DP5340国产替代CM5340立体声音频A/D转换器芯片
Playing script killing with AI: actually more involved than me
golang : Zap log integration
selenium module
Architectural Design Guide How to Become an Architect
随机推荐
go : create database records using gorm
The introduction of AI meta-learning into neuroscience, the medical effect is expected to improve accurately
深度学习:线性回归模型
docker部署redis一主二从三哨兵模式
VR机器人教你如何正确打乒乓球
Electron使用romote报错 : Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
01 多线程与高并发 - 基础概念
2020 ACM | MoFlow: An Invertible Flow Model for Generating Molecular Graphs
Map file analysis in Keil software
识别“数据陷阱”,发现数据的可疑之处
golang : Zap log integration
包含min函数的栈(js)
Go语学习笔记 - gorm使用 - 数据库配置、表新增 Web框架Gin(七)
What new materials are used in the large aircraft C919?
Handler消息机制-Native层
解决datagrip连接sqlserver报错:[08S01] 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。
DP5340 domestic replacement for CM5340 stereo audio A/D converter chip
Mybitatis相关配置文件
k8s 部署mysql8(PV和PVC 版本)
和AI一起玩儿剧本杀:居然比我还入戏