1.登陆mysql或者mariadb(两种任选其一)[root@localhost ~]# mysql -u root [root@localhost ~]# mysql -uroot -p 2.切换到存储用户名和密码的数据库 MariaDB [mysql]> use mysql;回车,会显示以下内容 Reading table information for completion of table and column names You can turn off this...
centosmysql5-7怎么改密码
centosmysql5-7怎么改密码
1.登陆mysql或者mariadb(两种任选其一)
[root@localhost ~]# mysql -u root
[root@localhost ~]# mysql -uroot -p
2.切换到存储用户名和密码的数据库
MariaDB [mysql]> use mysql;回车,会显示以下内容
Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed
3.修改密码,适用password()函数进行加密,实际上就是执行sql语句来更新指定用户的密码
MariaDB [mysql]> update user set password=password('新密码') where user='要更新密码的用户名';回车2017-09-03