阿里云esc centos7.2 镜像 因系统yum源良好 未做源的其他切换
yum install mysql-server
不要安装 yum install mysql 这是俩个不同的服务 卸载 yum remove mysql
验证安装
mysqladmin --version
启动
systemctl start mysql
远程连接设置,需要先在 root用户登录到mysql服务中
mysql -u root
#切换到系统库
use mysql;
#创建远程访问用户
CREATE USER daylog@'%' IDENTIFIED BY 'MyNewPass@123';
#我这个版本去除了password的函数不能在使用insert 插入用户 update 修改用户
update user set Host="%",authentication_string=password("root@daylog") where user = "root";
#会报一个语法错误
#ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '("root@daylog") where user = root' at line 1
#查看新的用户
select Host,user,authentication_string from user;
#给新用户授权
grant select,insert,update,dele