当前位置:网站首页>centos7.3修改mysql默认密码_详解Centos7 修改mysql指定用户的密码
centos7.3修改mysql默认密码_详解Centos7 修改mysql指定用户的密码
2022-06-24 22:47:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
本文介绍了Centos7 修改mysql指定用户的密码,具体如下:
1.登陆mysql或者mariadb(两种任选其一)
[[email protected] ~]# mysql -u root
[[email protected] ~]# 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服务
[[email protected] ~]# service mysqld restart(重启mysql)
[[email protected] ~]# service mariadb restart(重启mariadb)
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/151772.html原文链接:https://javaforall.cn
边栏推荐
- Cake review fatigue in the secondary market of innovative drugs: phase III clinical success and product approval
- Lizuofan, co-founder of nonconvex: Taking quantification as his lifelong career
- MeterSphere開源持續測試平臺與阿裏雲雲效DevOps的集成
- 非凸联合创始人李佐凡:将量化作为自己的终身事业
- Basic layout -qhboxlayout class, qvboxlayout class, qgridlayout class
- qt打包exe文件,解决“无法定位程序输入点_ZdaPvj于动态链接库Qt5Cored.dll”
- 年已过半,年终立的Flag实现了几个?
- 入职一家新公司,如何快速熟悉代码?
- Intranet learning notes (6)
- 获取图片外链的方法–网易相册[通俗易懂]
猜你喜欢

【FPGA】串口以命令控制温度采集

Talking about the advantages of flying book in development work | community essay solicitation

Rod and Schwartz cooperated with ZhongGuanCun pan Lianyuan Institute to carry out 6G technology research and early verification

I've been doing software testing for two years. I'd like to give some advice to girls who are still hesitating

Chinese address and English address

记一次beego通过go get命令后找不到bee.exe的坑

数据库系统概论必背知识

Intranet learning notes (5)

Left hand dreams right hand responsibilities GAC Honda not only pays attention to sales but also children's safety

都2022年了,你还不了解什么是性能测试?
随机推荐
Can automate - 10k, can automate - 20K, do you understand automated testing?
beescms网站渗透测试和修复意见「建议收藏」
write a number of lines to a new file in vim
字符串数组转换为list集合
ida中交叉引用的解析
After integrating the aurora push plug-in in the uni app, the real machine debugging prompts "the currently running base does not contain the native plug-in [jg-jpush]..." Solutions to problems
Are programmers from Huawei, Alibaba and other large manufacturers really easy to find?
MCN机构遍地开花:博主和作者要谨慎签约、行业水很深
Redistemplate operates redis. This article is enough (I) [easy to understand]
会自动化—10K,能做自动化—20K,你搞懂自动化测试没有?
Stocking but not completely stocking (daily question 2 in spring)
Application of TSDB in civil aircraft industry
进入阿里做测试员遥不可及?这里或许有你想要的答案
获取图片外链的方法–网易相册[通俗易懂]
Qt中使用QDomDocument操作XML文件
write a number of lines to a new file in vim
How do the TMUX color palette work?
LINQ query (3)
入职一家新公司,如何快速熟悉代码?
LogMiner 数据库日志挖掘