- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
关闭正在运行的 MySQL :
[root@www.landui.com ~]# service mysql stop
特权模式运行
[root@www.landui.com ~]# mysqld_safe --skip-grant-tables &
为了安全可以禁止远程连接:
[root@www.landui.com ~]# mysqld_safe --skip-grant-tables --skip-networking &
登录数据库
[root@www.landui.com ~]# mysql -p
更改密码:
mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
注意:
新版的mysql数据库下的user表中已经没有Password字段了,而是将加密后的用户密码存储于authentication_string字段。
5.7需要再次设置密码
mysql> alter user 'root'@'localhost' identified by '123';
或者:
mysql> set password for 'root'@'localhost'=password('123');
刷新权限
mysql> flush privileges;
mysql> quit;
修改完毕。重启
[root@localhost ~]# service mysql restart
然后mysql就可以连接了
售前咨询
售后咨询
备案咨询
二维码
TOP