CentOS7安装Mysql

说明:命令从上往下

yum install mysql*  安装mysql相关依赖

yum install mariadb-server

systemctl start mariadb.service

mysqladmin -u root  password xxxx  设置root用户密码

mysql -uroot -p xxxx  登录mysql

grant all privileges on *.* to root@'%' identified by '******'  ***表示数据库连接密码,设置允许远程连接