Linux CentOS 7 安装mysql的步骤

#wget命令用来从指定的URL下载文件

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install mysql-community-server

重启mysql服务

service mysqld restart || systemctl restart mysqld.service

mysql -uroot 回车

默认安装完,root是没有密码的,需要手动添加密码

#set password for 'root'@'localhost'=password('密码');

set password for 'root'@'localhost'=password('root');

#给root用户赋予远程登录权限

grant all privileges on *.* to root@'%' identified by 'root' with grant option;

#刷新mysql权限

flush privileges;

#开放3306端口

firewall-cmd --zone=public --add-port=3306/tcp --permanent

#重启防火墙

systemctl restart firewalld

相关推荐
wydaicls11 小时前
Linux 系统下 ZONE 区域的划分
linux·运维·服务器
带土111 小时前
17. Linux wc命令
linux
螺旋小蜗11 小时前
Linux Cgroup与Device Whitelist详解
linux·运维·服务器·cgroup
染指111012 小时前
36.渗透-端口
linux·运维·服务器
takashi_void12 小时前
如何在本地部署大语言模型(Windows,Mac,Linux)三系统教程
linux·人工智能·windows·macos·语言模型·nlp
大聪明-PLUS12 小时前
QEMU:如何组织与 I2C 设备的透明交互
linux·嵌入式·arm·smarc
sulikey13 小时前
【Linux权限机制深入理解】为何没有目录写权限仍能修改文件权限?
linux·运维·笔记·ubuntu·centos
liu****13 小时前
8.list的模拟实现
linux·数据结构·c++·算法·list
biubiubiu070613 小时前
VPS SSH密钥登录配置指南:告别密码,拥抱安全
linux
人生苦短,菜的抠脚14 小时前
Linux 内核IIO sensor驱动
linux·驱动开发