当前位置:网站首页>mysql_linux版本的下载及安装详解
mysql_linux版本的下载及安装详解
2022-04-23 18:48:00 【#眼镜&】
文章目录
1、mysql的下载
MySQL 的官网下载地址: 官网




2、mysql的安装
上传到: /usr/local/mysql
查看centos自带的mysql,若存在则移除
rpm -qa | grep mysql # 查看
rpm -ev mysql-libs-* --nodeps # 删除
安装rpm包
rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm --force --nodeps
–force --nodeps: 表示安装时不检查依赖关系
启动mysql
# 查看mysql的状态
service mysqld status
service mysqld start
初始化随机密码
cat /var/log/mysqld.log | more
查看随机密码:
grep pass /var/log/mysqld.log --color
登陆并修改密码:
[root@web ~]#mysql -uroot -p
mysql> set password='Pwd@123456';
mysql> grant all privileges on *.* to 'root'@'%' identified by 'Pwd@123456';
设置开机自启动
chkconfig --add mysql
# 查看是否添加成功
chkconfig --list
如果上一步添加不成功,则手动添加到启动配置文件里
vim /etc/rc.d/rc.local
# 添加
service mysqld start
防火墙端口策略
# 添加3306端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
# 保存
/etc/init.d/iptables save
# 重启
service iptables restart
# 查看状态
/etc/init.d/iptables status
版权声明
本文为[#眼镜&]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_45858803/article/details/124357241
边栏推荐
- 中金财富怎么样?在上边开户安全吗
- The first leg of the national tour of shengteng AI developer creation and enjoyment day was successfully held in Xi'an
- Scrollto and scrollby
- Esp32 (UART ecoh) - serial port echo worm learning (2)
- ESP32 LVGL8. 1 - calendar (calendar 25)
- ESP32 LVGL8. 1 - arc (arc 19)
- 特征选择feature_selection--SelectKBest
- Methods of nested recycleview to solve sliding conflict and incomplete item display
- iptables初探
- ESP32 LVGL8. 1 - slider slider (slider 22)
猜你喜欢

PyGame tank battle

Download xshell 6 and xftp6 official websites

Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha

Druid SQL和Security在美团点评的实践

7、 DOM (Part 2) - chapter after class exercises and answers

Custom prompt box MessageBox in QT

On iptables

【科普】CRC校验(一)什么是CRC校验?

iptables初探

Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
随机推荐
Druid SQL和Security在美团点评的实践
ESP32 LVGL8. 1 - bar progress bar (bar 21)
Download xshell 6 and xftp6 official websites
Esp32 (UART event) - serial port event learning (1)
Daily network security certification test questions (April 18, 2022)
iptables初探
MySQL statement
Ionic instruction set order from creation to packaging
昇腾 AI 开发者创享日全国巡回首站在西安成功举行
QT error: no matching member function for call to ‘connect‘
Test questions of daily safety network (February 2024)
ESP32 LVGL8. 1 - BTN button (BTN 15)
ESP32 LVGL8. 1 - slider slider (slider 22)
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
QT curve / oscilloscope customplot control
机器学习理论基础篇--关于机器学习的一些术语
Daily network security certification test questions (April 13, 2022)
Machine learning theory (8): model integration ensemble learning
STM32: LCD显示
使用晨曦记账本,分析某个时间段每个账户收支结余