linux安装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;
需要开放端口重启防火墙