当前位置:网站首页>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://yzsam.com/2022/04/202204231848086201.html
边栏推荐
- 22年字节跳动飞书人力套件三面面经
- os_ authent_ Prefix
- 七、DOM(下) - 章节课后练习题及答案
- Click the input box to pop up the keyboard layout and move up
- Deeply understand what new and make in golang are and what are the differences?
- QT error: no matching member function for call to ‘connect‘
- Ionic instruction set order from creation to packaging
- Actual combat of Nacos as service configuration center
- QT curve / oscilloscope customplot control
- Coolweather is revised and connected to the wind weather interface to realize the broken line diagram of temperature
猜你喜欢
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
ESP32 LVGL8. 1 - label (style 14)
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
机器学习理论之(7):核函数 Kernels —— 一种帮助 SVM 实现非线性化决策边界的方式
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
os_authent_prefix
【科普】CRC校验(一)什么是CRC校验?
listener. log
Teach you to quickly rename folder names in a few simple steps
iptables -L执行缓慢
随机推荐
ESP32 LVGL8. 1 - img picture (IMG 20)
Nacos集群搭建和mysql持久化配置
Esp32 (UART receiving and sending) - receiving and sending communication of serial port (4)
Introduction to ROS learning notes (II)
Go 语言 GUI 框架 fyne 中文乱码或者不显示的问题
PyGame tank battle
SQL中函数 decode()与 replace()的用法
: app: transformclasseswithrobustfordevrease meituan hot repair compilation error record
ESP32 LVGL8. 1. Detailed migration tutorial of m5stack + lvgl + IDF (27)
Machine learning theory (8): model integration ensemble learning
Ucosiii transplantation and use, reference punctual atom
根据快递单号查询物流查询更新量
QT error: no matching member function for call to ‘connect‘
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
ESP32 LVGL8. 1 - roller rolling (roller 24)
Eight bit binary multiplier VHDL
Deeply understand what new and make in golang are and what are the differences?
Sentinel service fusing practice (sentinel integration ribbon + openfeign + fallback)
os_ authent_ Prefix
Esp32 (UART event) - serial port event learning (1)