当前位置:网站首页>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
边栏推荐
猜你喜欢
Eight bit binary multiplier VHDL
kettle庖丁解牛第17篇之文本文件输出
ESP32 LVGL8. 1 - roller rolling (roller 24)
WebView opens H5 video and displays gray background or black triangle button. Problem solved
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
Simple use of navigation in jetpack
昇腾 AI 开发者创享日全国巡回首站在西安成功举行
MVVM模型
On iptables
iptables -L执行缓慢
随机推荐
教你用简单几个步骤快速重命名文件夹名
机器学习实战 -朴素贝叶斯
Scrollto and scrollby
Halo open source project learning (VII): caching mechanism
Summary of actual business optimization scheme - main directory - continuous update
[popular science] CRC verification (I) what is CRC verification?
K210 serial communication
Database computer experiment 4 (data integrity and stored procedure)
iptables -L执行缓慢
Ctfshow - web362 (ssti)
One of the reasons why the WebView web page cannot be opened (and some WebView problem records encountered by myself)
CISSP certified daily knowledge points (April 14, 2022)
Dynamically add and delete layouts
Setting up keil environment of GD single chip microcomputer
Can filter
CISSP certified daily knowledge points (April 15, 2022)
The corresponding permissions required to automatically open the app in the setting interface through accessibility service
昇腾 AI 开发者创享日全国巡回首站在西安成功举行
Nacos cluster construction and MySQL persistence configuration
After CANopen starts PDO timing transmission, the heartbeat frame time is wrong, PDO is delayed, and CANopen time axis is disordered