注意事项:
先关闭虚拟机防火墙 关闭防火墙命令:
systemctl stop firewalld.service
如果权限不够 在命令前加sudo(超级管理员)
安装mysql数据库步骤:
sudo yum install mysql
sudo yum install mariadb-server mariadb
sudo yum install mysql-devel
启动mysql数据库:
systemctl start mariadb
登录mysql数据库:
mysql -u root
登录后切换到mysql数据库:
use mysql
修改用户root的密码,修改为111111:
set password for 'root'@'localhost' =password('111111');
授权:
grant all privileges on *.* to root@'%'identified by '111111';
重启数据库 先退出再重启,退出命令exit
systemctl restart mariadb
停止数据库:
systemctl stop mariadb