centos
- 修改配置文件
vi /etc/my.cnf
在[mysqld]配置下面添加
skip-grant-tables
- 重启mysqld
systemctl restart mysqld
- 修改密码,刷新
update user set authentication_string=password('123abc') where user='root';
flush privileges;
赋权
GRANT ALL PRIVILEGES ON *.* TO 'tms'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
- 恢复配置文件,重启mysqld
网友评论