当前位置: 首页 > news >正文

在柬埔寨做网站彩票推广微分销商城

在柬埔寨做网站彩票推广,微分销商城,wordpress功能小工具增加按钮,网站开发构成这篇文章主要介绍了MySQL修改密码的几种方式#xff0c;帮助大家更好的理解和使用MySQL#xff0c;感兴趣的朋友可以了解下前言#xff1a;在日常使用数据库的过程中#xff0c;难免会遇到需要修改账号密码的情景#xff0c;比如密码太简单需要修改、密码过期需要修改、忘…这篇文章主要介绍了MySQL修改密码的几种方式帮助大家更好的理解和使用MySQL感兴趣的朋友可以了解下前言在日常使用数据库的过程中难免会遇到需要修改账号密码的情景比如密码太简单需要修改、密码过期需要修改、忘记密码需要修改等。本篇文章将会介绍需要修改密码的场景及修改密码的几种方式。1.忘记 root 密码忘记 root 密码的场景还是比较常见的特别是自己搭的测试环境经过好久没用过时很容易记不得当时设置的密码。这个时候一般常用的方法是跳过权限验证然后更改 root 密码之后再启用权限验证。以 MySQL 5.7 版本为例简单讲下主要过程首先修改配置文件在[mysqld]部分加上一句skip-grant-tables 加上此参数的目的是跳过权限验证。然后重启数据库数据库再次启动后我们就可以不用密码直接登录数据库修改密码了。# skip-grant-tables 模式下修改root密码[roothost ~]# mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 16Server version: 5.7.23-log MySQL Community Server (GPL)Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type help; or \h for help. Type \c to clear the current input statement.mysql update mysql.user set authentication_string  password (xxxxxx) where user  root and host  localhost;Query OK, 0 rows affected, 1 warning (0.00 sec)Rows matched: 1  Changed: 0  Warnings: 1mysql flush privileges;Query OK, 0 rows affected (0.01 sec)修改完 root 密码后再次去除 skip-grant-tables 参数然后重启下数据库即可。2.几种修改密码的方法除去忘记密码可能还有其他情景需要修改密码这时候就可以采取普通方式修改密码了。还是以 MySQL 5.7 版本为例介绍几种常用的修改密码的方法。使用 alter user 修改比如如果想更改 testuser 账号的密码我们可以使用 root 账号登录然后执行 alter user 命令更改 testuser 账号的密码。mysql alter user testuser% identified by Password1;Query OK, 0 rows affected (0.01 sec)mysql flush privileges;Query OK, 0 rows affected (0.00 sec)使用 SET PASSWORD 命令使用 SET PASSWORD 修改密码命令格式为 SET PASSWORD FOR usernamehost PASSWORD(newpass); 同样是使用 root 账号可修改其他账号的密码。mysql SET PASSWORD FOR testuser%  PASSWORD(Password2);Query OK, 0 rows affected, 1 warning (0.00 sec)mysql flush privileges;Query OK, 0 rows affected (0.00 sec)使用 mysqladmin 修改密码使用 mysqladmin 命令修改账号密码格式为 mysqladmin -u用户名 -p旧密码 password 新密码[roothost ~]# mysqladmin -utestuser -pPassword2 password Password3mysqladmin: [Warning] Using a password on the command line interface can be insecure.Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.[roothost ~]# mysql -utestuser -pPassword3mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2388Server version: 5.7.23-log MySQL Community Server (GPL)Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type help; or \h for help. Type \c to clear the current input statement.mysql直接 update user 表其实 MySQL 所以的账号信息都存储在 mysql.user 表里面我们也可以直接通过 update user 表来修改密码。# 5.7及之后版本mysql update mysql.user set authentication_string  password (Password4) where user  testuser and host  %;Query OK, 1 row affected, 1 warning (0.06 sec)Rows matched: 1  Changed: 1  Warnings: 1mysql flush privileges;Query OK, 0 rows affected (0.01 sec)# 5.6及之前版本update mysql.user set passwordpassword(新密码) where user用户名 and hosthost;3.设置 login-path 本地快捷登陆为了防止密码暴露及忘记密码我们还可以设置 login-path 来实现在本地不输密码快捷登录。login-path 是 MySQL 5.6 开始支持的新特性。通过借助 mysql_config_editor 工具将登陆 MySQL 服务的认证信息加密保存在 .mylogin.cnf 文件(默认位于用户主目录)。MySQL 客户端工具可通过读取该加密文件连接 MySQL 实现快捷登录。假设我们想配置 root 账号在本地快捷登录可以这么做# 执行回车后需要输入一次root密码[roothost ~]# mysql_config_editor set --login-pathroot -uroot  -hlocalhost -p -P3306Enter password:# 配置完成后可以使用login-path登录[roothost ~]# mysql --login-pathrootWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2919Server version: 5.7.23-log MySQL Community Server (GPL)Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type help; or \h for help. Type \c to clear the current input statement.mysql总结本篇文章主要介绍了修改数据库账号密码的几种方法基本涵盖了所有的场景。这里也提醒下各位数据库账号最好限制ip段登录密码尽量复杂些最好能够定期修改特别是重要的环境不能有半点马虎。年底了安全才是王道。以上就是MySQL修改密码的几种方式的详细内容更多关于MySQL修改密码的资料请关注脚本之家其它相关文章来源脚本之家链接https://www.jb51.net/article/202370.htm申请创业报道分享创业好点子。点击此处共同探讨创业新机遇
http://www.huolong8.cn/news/138578/

相关文章:

  • 建设部标准定额司网站成都做公司网站推广
  • 网站怎么改域名dw网站制作怎么做滑动的图片
  • 兴安盟做网站公司济南小型网站建设
  • 主播网站建设建筑公司企业网站
  • 仙桃哪里做网站摄影比赛投稿网站
  • 网站全站出售厦门网站建设方案开发
  • 淘宝客网站做seo有用吗东营seo网站推广
  • 不备案的网站很慢网站建设与管理 情况总结
  • 合肥建设有限公司网站建设优化服务如何
  • 如何检测网站死链给人做网站的
  • 网站不在首页显示出来吗哪个公司做网站专业
  • 住房建设部官方网站常见服务器
  • 珠海门户网站建设价格吉林网站建设司
  • 深圳市找工作直招郑州seo教程
  • 做游戏CG分享的网站粤icp备网站建设 中企动力广州
  • 四川省建设厅网站打不开建筑网站 知乎
  • 网站设计青岛wordpress手机单页面
  • 泉州做 php 网站怎么做网站中英文版本
  • 怎么查网站有没有做404报告总结网站建设实验
  • 加盟营销型网站制作网站建设技术服务合同
  • 知道一个网站怎么知道是谁做的百度优化网站宽带值多少合适
  • 沈阳网站建设优化企业网络seo排名
  • 江门网站免费制作重庆信息网官网
  • 企业建设电子商务网站的预期收益美妆网站开发规划书
  • 外国手机网站设计品牌设计logo
  • 织梦网站404怎么做视频网站设计与开发
  • seo网站推广怎么做网站出现的的问题
  • 教育培训推广网站模板ps工具设计网站
  • 门户网站开发是什么外贸营销网站建站
  • 地方信息网站源码怎么查网站是用什么语言做的