服务市场
  • 交易市场
  • 平台大厅
  • 下载市场
  • 收录信息
  • A保平台
    平台客服
    微信Q群
    浏览记录



    平台微博/weibo    平台微信/公众号    平台抖音/快手   
    曝光台    保障    地图   
    上传资源 快速赚钱
    站保站    登录      |  注册  |  

    只需一步,快速开始!

     找回密码   |   协议
    热门搜索: 网站开发 App报毒 挖矿源码 代办资质

    MySQL破解root账户密码,及多实例部署

    • 时间:2020-10-27 16:34 编辑:碗里没有汤 来源: 阅读:69
    • 扫一扫,手机访问
    摘要:

    破解Mysql管理员账户密码

    1.进入配置文件/etc/my.conf,添加skip-grant-table:

    [root@server ~]# vim /etc/my.cnf
    
    [mysqld]
    basedir = /usr/local/mysql
    datadir = /opt/data
    socket = /tmp/mysql.sock
    port = 3306
    pid-file = /opt/data/mysql.pid
    user = mysql
    skip-name-resolve
    
    skip-grant-tables
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    2.重启服务

    [root@server ~]# service mysqld restart
    Shutting down MySQL.... SUCCESS! 
    Starting MySQL.. SUCCESS! 
    
    • 1
    • 2
    • 3

    3.更新mysql.user表,设置user=root,并且host=localhost的记录中authentication_string的密码

    mysql> update mysql.user set authentication_string = password('tjp123') where User = 'root' and Host = 'localhost';
    Query OK, 1 row affected, 1 warning (0.36 sec)
    Rows matched: 1  Changed: 1  Warnings: 1
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5

    4.删除配置文件中的skip-grant-tables重启服务
    5.重启服务

    [root@server ~]# service mysqld restart
    Shutting down MySQL.... SUCCESS! 
    Starting MySQL.. SUCCESS! 
    
    
    • 1
    • 2
    • 3
    • 4

    验证

    [root@server ~]# mysql -uroot -ptjp123
    mysql: [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 2
    Server version: 5.7.22 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 its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    MySQL多实例部署

    手动版

    创建各实例数据存放的目录

    [root@server data]# mkdir -p /opt/data/{3306,3307,3308}
    [root@server data]# ls
    3306            ib_logfile1       mysql_bin.000016    server.err
    3307            ibtmp1            mysql_bin.000017    sys
    3308            mysql             mysql_bin.000018    tjp
    
    • 1
    • 2
    • 3
    • 4
    • 5

    初始化各实例

    [root@server ~]# mysqld --initialize --user=mysql --datadir=/opt/data/3306
    [root@server ~]# mysqld --initialize --user=mysql --datadir=/opt/data/3307
    [root@server ~]# mysqld --initialize --user=mysql --datadir=/opt/data/3308
    截取密码
    _KhT(H5rR;Cm
    kqzAwRO<=0qf
    R%>Uehoh=80(
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    安装perl

    [root@server ~]# yum -y install perl
    
    
    • 1
    • 2

    配置配置文件/etc/my.cnf

    [mysqld_multi]
    mysqld = /usr/local/mysql/bin/mysqld_safe
    mysqladmin = /usr/local/mysql/bin/mysqladmin
    
    [mysqld3306]
    datadir = /opt/data/3306
    port = 3306
    socket = /tmp/mysql3306.sock
    pid-file = /opt/data/3306/mysql_3306.pid
    log-error=/var/log/3306.log
    
    [mysqld3307]
    datadir = /opt/data/3307
    port = 3307
    socket = /tmp/mysql3307.sock
    pid-file = /opt/data/3307/mysql_3307.pid
    log-error=/var/log/3307.log
    
    [mysqld3308]
    datadir = /opt/data/3308
    port = 3308
    socket = /tmp/mysql3308.sock
    pid-file = /opt/data/3308/mysql_3308.pid
    log-error=/var/log/3308.log
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25

    启动各实例

    [root@server ~]# mysqld_multi start 3306
    Wide character in print at /usr/local/mysql/bin/mysqld_multi line 672.
    [root@server ~]# mysqld_multi start 3307
    [root@server ~]# mysqld_multi start 3308
    
    [root@server data]# ss -antl
    State    Recv-Q   Send-Q     Local Address:Port       Peer Address:Port   
    LISTEN   0        80                     *:3306                  *:*      
    LISTEN   0        80                     *:3307                  *:*      
    LISTEN   0        50                  [::]:139                [::]:*      
    LISTEN   0        80                     *:3308                  *:*    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    自动版

      • 全部评论(0)
      最新发布的资讯信息
      【技术文档|数据库】oracle存储脚本案例(2020-10-27 23:31)
      【技术文档|数据库】Redis缓存穿透和缓存雪崩的分析与解决方案(2020-10-27 23:21)
      【技术文档|数据库】Oracle表空间扩容(2020-10-27 22:45)
      【技术文档|数据库】Mybatis-关联和集合(2020-10-27 22:41)
      【技术文档|数据库】C# 使用Redis(2020-10-27 22:32)
      【技术文档|数据库】idea连接sqlserver及数据库操作(2020-10-27 21:53)
      【技术文档|数据库】SQLZOO知识点补充(2020-10-27 21:50)
      【技术文档|数据库】sql事务(2020-10-27 21:23)
      【技术文档|数据库】打包部署及mysql在linxu上的安装(2020-10-27 21:20)
      【技术文档|数据库】服务器部署(2020-10-27 21:15)

      微信客服(速回)

      微信客服(慢回)



      企业微信客服二维码
      联系我们
      平台客服: 平台QQ客服

      平台电话:400电话迁移中!

      平台邮箱:28292383@qq.com

      工作时间:周一至周五:早10:00 晚:18:00

      营业执照     网站ICP备案:鲁ICP备20027607号     鲁公网安备:37068702000078号     增值电信业务经营许可证、在线数据与交易处理业务许可证:鲁B2-20200681      © 2016-2024 站保站  https://www.zhanbaozhan.com/ 版权所有!      A保站平台规范:   关于我们   广告合作   隐私条款   免责声明   法律声明   服务条款   网站地图   平台工单!