| 您的当前位置:首页 --> MYSQL教程 --> 详解Centos7 修改mysql指定用户的密码 |
| MYSQL教程 详解Centos7 修改mysql指定用户的密码 |
| 浏览次数:1129 关键词 ( ) |
| 查看使用该CPU的产品 查看CPU天梯 |
| CPU型号:详解Centos7 修改mysql指定用户的密码 |
| 主频:Ghz |
| 睿频:Ghz |
| 核心数:个 |
| 不支持超核心 |
| 制作工艺: |
| 插槽类型: |
| 功耗:0W |
| L3缓存:0MB |
| 支持最大内存: 0GB |
| CPU详细参数 |
|
本文介绍了Centos7 修改mysql指定用户的密码,具体如下: 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='要更新密码的用户名';回车
-> ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 5 Changed: 0 Warnings: 0
4.刷新用户权限列表 MariaDB [mysql]> flush privileges;回车 Query OK, 0 rows affected (0.00 sec) 5.退出mysql登陆 MariaDB [mysql]> quit Bye 6.重启mysql或者mariadb服务 [root@localhost ~]# service mysqld restart(重启mysql) [root@localhost ~]# service mariadb restart(重启mariadb) 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持80vps。 |
| 下一个产品 SQL计算timestamp的差值的方法 上一个产品 MySql创建带解释的表及给表和字段加注释的实现代码 |