卸载mysql(centos)转
安装mysql(centos 7)
yum安装
# 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
修改自己安装版本,可以在官网找到对应的wget地址替换
重启:
service mysqld restart
root登录
mysql -uroot -ppassword
第一次登录修改root密码
之后登录进去,在修改一次密码
解决办法
1、 修改用户密码
mysql> alter user ‘root’@’localhost’ identified by ‘youpassword’;
或者
mysql> set password=password(“youpassword”);
2、刷新权限
mysql> flush privileges;
允许远程登录:
mysql> grant all privileges on *.* to root@'%'identified by 'password';