一、安装和配置
参考博客:http://www.2cto.com/database/201208/145900.html
(1)使用yum命令安装MysqL
yum list MysqL
(2)安装过后需要启动MysqL服务
service MysqLd start
如需重启:
service MysqLd restart
MysqLadmin -u root password jereh123
(4)进入MysqL
MysqL -u root -p
(5)新增一个用户
grant all on *.* to 'user'@'%' IDENTIFIED BY 'password';
二、后期遇到远程连接不上服务器上得MysqL
问题1:1130 host is not allowedto connect to this MysqL server
MysqL -u -p
执行命令:
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;
exit;
问题2:1045Access denied for user 'root'@'localhost' (using password: YES)
参考博客:http://www.cnblogs.com/qq78292959/p/3641972.html
1.停掉MysqL:
service MysqLd stop
2.使用如下命令并且结束
MysqLd_safe --user=MysqL --skip-grant-tables --skip-networking &
MysqL -u root -p
4.重新设置密码刷新并退出
UPDATE user SET Password=PASSWORD('cl155213') where USER='root';
FLUSH PRIVILEGES;
quit
远程连接OK