当前位置:网站首页>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
边栏推荐
- listener.log
- Sentinel service fusing practice (sentinel integration ribbon + openfeign + fallback)
- ESP32 LVGL8. 1 - roller rolling (roller 24)
- About the operation of unit file reading (I)
- Daily network security certification test questions (April 15, 2022)
- 深入理解 Golang 中的 new 和 make 是什么, 差异在哪?
- PyGame tank battle
- Can filter
- : app: transformclasseswithrobustfordevrease meituan hot repair compilation error record
- Ucosiii transplantation and use, reference punctual atom
猜你喜欢
ESP32 LVGL8. 1 - calendar (calendar 25)
ctfshow-web361(SSTI)
ESP32 LVGL8. 1 - msgbox message box (msgbox 28)
【历史上的今天】4 月 23 日:YouTube 上传第一个视频;网易云音乐正式上线;数字音频播放器的发明者出生
os_ authent_ Prefix
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
Download xshell 6 and xftp6 official websites
Setting up keil environment of GD single chip microcomputer
ctfshow-web361(SSTI)
Iptables - L executes slowly
随机推荐
CISSP certified daily knowledge points (April 14, 2022)
Halo open source project learning (VII): caching mechanism
STM32: LCD显示
listener. log
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
配置iptables
Esp32 (UART 485 communication) - 485 communication of serial port (3)
: app: transformclasseswithrobustfordevrease meituan hot repair compilation error record
Chondroitin sulfate in vitreous
关于unity文件读取的操作(一)
[popular science] CRC verification (I) what is CRC verification?
Configure iptables
Excel intercept text
Query the logistics update quantity according to the express order number
ESP32 LVGL8. 1 - slider slider (slider 22)
listener.log
QT excel operation summary
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
Practice of Druid SQL and security in meituan review
迁移学习进阶