当前位置:网站首页>Linux Mysql安装
Linux Mysql安装
2022-06-23 08:15:00 【RhineHe_hjs】
Mysql安装
进入官网https://dev.mysql.com/downloads/mysql/复制你要安装的版本链接地址
一.下载mysql
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.29-linux-glibc2.12-x86_64.tar.xz
2.解压 mysql
tar -xf mysql-8.0.29-linux-glibc2.12-x86_64.tar.xz
3.移动到安装路径并重名
mv mysql-8.0.29-linux-glibc2.12-x86_64 /app/mysql/mysql-8.0.29
4.建立数据文件夹和日志文件夹
mkdir /app/mysql/data
mkdir /app/mysql/logs
5.切换到mysql文件夹下
cd /app/mysql
6.创建用户mysql并将文件的权限赋给用户mysql
useradd mysql
chown -R mysql .
chgrp -R mysql .
7.初始化mysql
切换到安装目录下执行以下命令:cd /app/mysql/mysql8.0.29
./bin/mysqld --initialize --user=root --basedir=/app/mysql/mysql8.0.29 --datadir=/app/mysql/data
8.添加mysql到系统服务
cp -a ./support-files/mysql.server /etc/init.d/mysql
9.修改启动脚本:vim /etc/init.d/mysql
basedir=
datadir=
#改成如下
basedir=/app/mysql/mysql8.0.29
datadir=/app/mysql/data
10.启动mysql服务
service mysql start
启动成功如下:
11.登录mysql使用初始化mysql临时生成的密码(若是忘了找不到了,删除data下的所有文件重新初始化,登录时可以粘贴复制的密码)
mysql -uroot -p
12.修改登录密码替代临时密码并允许远程连接(以下命令依次执行)
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘root’;
use mysql;
update user set Host=‘%’ where User=‘root’;
flush privileges;
exit;
13.开发防火墙中mysql的3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
systemctl restart firewalld
边栏推荐
- Go 数据类型篇(三)之整型及运算符
- 2- use line segments to form graphics and coordinate conversion
- Implementation of AVL tree
- typeScript的介绍与变量定义的基本类型
- GTEST死亡测试
- C RichTextBox controls the maximum number of rows
- The essence of five good books on wealth and freedom
- Install a WGet for your win10
- Object.defineProperty() 和 数据代理
- 5-旋转的小菊-旋转画布和定时器
猜你喜欢

Why do we say that the data service API is the standard configuration of the data midrange?

Self organizing map neural network (SOM)

黄蓉真的存在吗?

给你的win10装一个wget
![Vulnhub | DC: 4 | [combat]](/img/33/b7422bdb18f39e9eb55855dbf1d584.png)
Vulnhub | DC: 4 | [combat]

通信方式总结及I2C驱动详解

开源技术交流丨批流一体数据同步引擎ChunJun数据还原-DDL功能模块解析

Multi-scale feature combination in target detection

Introduction to typescript and basic types of variable definitions

A record of "from scratch" in college student accounts
随机推荐
[cross border e-commerce solutions] lighthouse will be used for pure IP expansion of new business - continuous efforts!
4- draw ellipse, use timer
Huawei ECS EIP cannot be pinged
How to migrate x86 architecture applications to arm architecture at low cost
词性家族
史上最污技术解读,60 个 IT 术语我居然秒懂了......
Observer mode
MySQL common skills
训练后的随机森林模型导出和加载
Keng dad's "dedication blessing": red packet technology explosion in Alipay Spring Festival Gala
高通9x07两种启动模式
Implementation of AVL tree
2-用线段构成图形、坐标转换
Image segmentation - improved network structure
2- use line segments to form graphics and coordinate conversion
Open source technology exchange batch stream integrated data synchronization engine Chunjun data restore DDL function module analysis
Explanation on webrtc's stun/turn service in tsingsee green rhino video
ThreadPoolExecutor线程池实现原理与源码解析
自组织映射神经网络(SOM)
typeScript的介绍与变量定义的基本类型