root‘@‘localhost‘ (using password: NO)"/>
Centos7下安装Mysql5.7出现 ‘root‘@‘localhost‘ (using password: NO)
1.注意是No,常规是(using password: YES)
2.首先关闭mysql服务
service mysqld stop
3.修改配置文件跳过密码验证
vim /etc/myf[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
skip-grant-tables
保存退出
就可以无密码登录Mysql
mysql -uroot
修改user表中的密码,5.7user表密码字段更改不是password
mysql> update user set password=password("*******") where user="*******"; #修改密码报错
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update mysql.user set authentication_string=password('*******') where user='*******'; #修改密码成功
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1mysql> flush privileges; #立即生效
Query OK, 0 rows affected (0.00 sec)mysql> quit
Bye
退出mysql,改回原配置文件,重启MySQL
更多推荐
Centos7下安装Mysql5.7出现 ‘root‘@‘localhost‘ (using password: NO)
发布评论