VMware虚拟机-Linux系统-从入门到放弃--Linux环境应用部署 -安装mysql数据库:四
ps:2022.04.02;初版本;待修改;全是bug;可能没有参考价值
下面这个教程是旧版本和新版本不一样
看最新教程
https://www.cnblogs.com/yylmzxc/p/16282759.html
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
rpm -ivh
ls -1 /etc/yum.repos.d/mysql-community*
执行yum install mysql-server在线安装,如提示:没有可用软件包 mysql-server,执行以下操作:
第一步:安装从网上下载文件的wget命令
yum -y install wget
第二步:下载mysql的repo源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
第三步:安装mysql-community-release-el7-5.noarch.rpm包
rpm -ivh mysql-community-release-el7-5.noarch.rpm
第四步:查看下
ls -1 /etc/yum.repos.d/mysql-community*
会获得两个mysql的yum repo源:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo
。第五步:安装mysql
yum -y install mysql-server
重启mysql
systemctl restart mysql.service
进入mysql
执行(密码默认为空)mysql -u root -p
登录mysql后输入如下命令:
grant all privileges on *.* to 'root' @'%' identified by 'root';
flush privileges;
rpm -qa|grep mysql
rpm -ev
mysql_install_db
###启动
q打开数据库
mysql -u root -p
登录
进入
use mysql
查看防火墙
systemctl status firewalld
关闭
systemctl stop firewalld
打开
systemctl status firewalld
打开数据库
mysql -u root -p
进入use mysql
show databases;
grant all privileges on *.* to 'root' @'%' identified by 'root';
flush privileges;
查看IP
ip addr