700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > mysql非root用户密码 CenterOS 8上修改msql的root密码和新增非root用户步骤

mysql非root用户密码 CenterOS 8上修改msql的root密码和新增非root用户步骤

时间:2024-02-12 16:48:58

相关推荐

mysql非root用户密码 CenterOS 8上修改msql的root密码和新增非root用户步骤

步骤一:

登录mysql,输入mysql -uroot -p并回车,此时登录成功。

步骤二:

检查mysql表是否可以看见,输入show databases;并回车。

步骤三:

查看root用户和其他用户之前的密码:

select host, user, password from mysql.user;

步骤四:

修改root用户密码:

Grant all privileges on *.* to 'root’@‘*' identified by '123456!' with grant option;

Grant all privileges on *.* to 'root’@'localhost' identified by '123456!' with grant option;

Grant all privileges on *.* to 'root’@‘127.0.0.1' identified by '123456!' with grant option;

步骤五:

新增michal并设置dink库的密码:

Grant all privileges on *dink* to ‘michal’@‘*' identified by '123456!' with grant option;

Grant all privileges on *dink* to ‘michal’@'localhost' identified by '123456!' with grant option;

Grant all privileges on *dink* to ‘michal’@‘127.0.0.1' identified by '123456!' with grant option;

步骤六:

执行刷新操作:

flush privileges;

步骤七:

查看root用户和其他用户之前的密码是否已经修改

select host, user, password from mysql.user;

步骤八:

退出命令行

quit

步骤十三:

重启mysql服务:

service mysqld restart

步骤十四:

执行命令,输入密码看是否能正常访问

mysql -uroot -p

mysql -umichal -p

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。