logo

knowledge 笔记记录

  • Git 笔记记录
    • 1. Github 和 Git 的密匙准备
    • 2. 基础操作
    • 3. .gitignore 文件以及其他文件
    • 4. 分支与合并
    • 5. 数据恢复以及返回机制
    • 6. 远程仓库的交互
    • 7. 标签的使用
    • 8. 扩展
    • 9. Gitee
      • 9.1. 问题集1
      • 9.2. gitee 远程仓库协作
    • 10. 问题集
      • 10.1. “warning: LF will be replaced by CRLF”
      • 10.2. 关于工作区、暂存区、版本区等名词的了解
      • 10.3. GitHub登录/访问难问题
      • 10.4. 无法将本地仓库的更新推送到github远程仓库
      • 10.5. 文件或文件夹的 git 提交历史
  • Java 笔记记录
    • java 核心技术 基础篇
      • 1. java的基本程序设计结构
      • 2. 类与对象
      • 3. 继承
      • 4. 反射
      • 5. 异常、断言
      • 6. 日志
      • 7. 泛型程序设计
      • 8. 集合
    • Effective Java
      • 1. 创建和销毁对象
    • 数据结构与算法分析——Java
      • 1. 算法分析
      • 2. 表 ADT
    • java多线程设计模式
      • 1. single threaded execution mode
      • 2. Guarded suspension mode and Balking mode
    • 扩展
      • 1. 修饰词 final
      • 2. Java 数据类型操作的原子性
      • 3. Java 字符串相关类的实现和说明
      • 4. Java 中 char 和 String 与字符编码的细节和使用注意
      • 5. 函数传值与深拷贝、浅拷贝
      • 6. Java 日期对象
      • 7. 基本数据类型及其封装类
      • 8. 双冒号 ``::`` 的用法
      • 9. Java 8 函数式编程—— Lambda
      • 10. 对IO流的多重封装
      • 11. IO 流缓存区
      • 12. StreamCorruptedException invalid type code AC
  • Spring 笔记记录
    • Spring
      • 1. 序
      • 2. 装配 Bean
      • 3. 高级装配
      • 4. @profile 注解
      • 5. 问题集
        • 5.1. POJO
        • 5.2. 耦合 *
        • 5.3. 如何运行 spring 实战4的示例代码
    • Spring Boot & Spring Cloud
      • 日志
      • 注解
      • 事务
      • 定时器
      • 签名与token
      • 拦截器
    • Maven
    • Nacos
    • Seata
    • Mybatis
      • mybatis 注意事项
    • 扩展
      • DDD领域驱动设计
  • SQL 笔记记录
    • 1. MySQL 5.7 安装
    • 2. SQL Server 2019 Developer 安装
    • 3. 关于 MSSQL 测试库的下载和安装
    • 4. 关于 MySQL 测试库的下载和安装
    • 5. SQL 通用技术
      • 5.1. 数据库和表的基本操作
      • 5.2. sql 常用关键字集
      • 5.3. 注释
      • 5.4. sql 函数
      • 5.5. sql isnull()
      • 5.6. sql insert into select
      • 5.7. 动态语句/拼接语句
      • 5.8. 视图
      • 5.9. 游标
      • 5.10. 存储过程以及存储函数
      • 5.11. 触发器
      • 5.12. 事务
      • 5.13. 索引
    • 6. T-sql
      • 6.1. 日期函数
    • 7. MySQL管理
    • 8. SQL 问题集
      • 8.1. 分页问题
      • 8.2. SQLServer 问题子集
  • Redis 笔记记录
    • 安装使用 redis
  • Node 笔记记录
    • NPM 笔记记录
      • NPM install
  • TypeScript 笔记记录
    • 1. 数据类型
    • 2. 变量声明
    • 3. 流程处理
    • 4. 字面量
    • 5. 类型推导
    • 6. 函数
    • 7. 类
    • 8. 泛型
    • 9. 关键字
    • 10. 封装对象
    • 11. 联合对象
    • 12. 命名空间
    • 13. 模块
    • 14. 声明文件
  • JavaScript 笔记记录
    • 箭头函数
  • Vue2 笔记记录
    • 1. 起步
    • 2. 指令
    • 3. 过滤器
    • 4. 组件
    • 5. 单文件组件
    • 6. 问题集
      • 6.1. npm ERR!
    • 7. 插件之路由
    • 8. 插件之数据交互
    • 9. vue-cli/脚手架
      • 9.1. HTML和静态资源
      • 9.2. 部署
  • Vue3 笔记记录
    • 1. 响应数据
    • 2. 计算属性
    • 3. 路由
    • 4. 状态管理-Vuex
    • 问题集1
  • Element-UI 笔记记录
    • 1. 起步
  • Python 笔记记录
    • 1. 自动化
      • 1.1. 模式匹配和正则表达式(1)
      • 1.2. 模式匹配和正则表达式(2)
    • 2. 扩展篇
      • 2.1. HTML 文本获取
      • 2.2. HTML 文本解析(一)
      • 2.3. HTML 文本解析(二)
      • 2.4. 网络爬虫模型
      • 2.5. 存储数据
    • 3. Python 包管理器 pip 的使用
    • 4. 离线安装 Python 及其依赖包
  • Linux 和 Shell 笔记记录
    • 运维篇
    • 基础篇(理论知识点篇)
    • 问题篇
      • 安装yum源
      • java1.8.0安装
      • 网络配置(虚拟机直接使用校园网上网)
      • “远程”连接虚拟机
      • 在Linux下vue项目的环境配置和运行
    • 云平台布置记录
      • 软件及其服务管理篇
      • 防火墙管理
      • Alibaba Cloud Linux
  • Batch&Shell 笔记记录
    • Shell Script
      • 变量
      • 数组
      • 传递参数
      • 输出
      • 运算符
    • Batch 批处理
    • Cmd 和 Powershell
      • 基础命令
  • 效率工具:代码模板

软件或工具包安装以及配置记录

  • bladex 快速开发平台的使用
    • 安装并初始化原始项目
    • Swagger 接口文档系统功能的使用
    • 项目部署
  • vscode
    • 1. 快速入门
    • 1. 终端的配置
    • 2. run code插件的运行配置
    • 3. 工作区的插件设置
    • 4. 不同需求下的 VS Code 插件环境配置
  • 一些常用软件的快捷键
  • Navicat Premium 实用技巧
Theme by the Executable Book Project
导航
  • Navicat 中怎么查看数据库密码
  • Linux Mysql8.0+数据库密码重置办法

Navicat Premium 实用技巧¶

Navicat 中怎么查看数据库密码¶

有时候,我们在连接 Navicat 中创建了一个数据库连接并成功连接后忘记了密码,这个时候我们可以通过以下方法来通过 Navicat 现有的数据库连接配置来获取其密码。

  • 第一步: 点击 Navicat 菜单栏 文件‣导出连接.. ,导出数据库连接配置,导出连接获取到 connections.ncx 文件

navicat-connect-config-output.png

图 11 导出数据库连接配置(勾选导出密码)¶

代码块 4 导出的 connections.ncx 文件示例¶
<?xml version="1.0" encoding="UTF-8"?>
<Connections Ver="1.4">
	<Connection ConnectionName="localhost_3306" ProjectUUID="" ConnType="MYSQL" OraConnType="" ServiceProvider="Default" Host="localhost" Port="3306" Database="" OraServiceNameType="" TNS="" MSSQLAuthenMode="" MSSQLAuthenWindowsDomain="" DatabaseFileName="" UserName="root" Password="E00641F75A8FFC2E7AF00CC29732DB6E" SavePassword="true" SettingsSavePath="C:\Users\qaz22\Documents\Navicat\MySQL\Servers\localhost_3306" SessionLimit="0" Encoding="0" Keepalive="false" KeepaliveInterval="240" MySQLCharacterSet="true" Compression="false" AutoConnect="false" NamedPipe="false" NamedPipeSocket="" OraRole="" OraOSAuthen="false" SQLiteEncrypt="false" SQLiteEncryptPassword="" SQLiteSaveEncryptPassword="false" UseAdvanced="false" SSL="false" SSL_Authen="false" SSL_PGSSLMode="REQUIRE" SSL_ClientKey="" SSL_ClientCert="" SSL_CACert="" SSL_Clpher="" SSL_PGSSLCRL="" SSL_WeakCertValidation="false" SSL_AllowInvalidHostName="false" SSL_PEMClientKeyPassword="" SSH="false" SSH_Host="" SSH_Port="22" SSH_UserName="" SSH_AuthenMethod="PASSWORD" SSH_Password="" SSH_SavePassword="false" SSH_PrivateKey="" SSH_Passphrase="" SSH_SavePassphrase="false" SSH_Compress="false" HTTP="false" HTTP_URL="" HTTP_PA="" HTTP_PA_UserName="" HTTP_PA_Password="" HTTP_PA_SavePassword="" HTTP_EQ="" HTTP_CA="" HTTP_CA_ClientKey="" HTTP_CA_ClientCert="" HTTP_CA_CACert="" HTTP_CA_Passphrase="" HTTP_Proxy="" HTTP_Proxy_Host="" HTTP_Proxy_Port="" HTTP_Proxy_UserName="" HTTP_Proxy_Password="" HTTP_Proxy_SavePassword=""/>
</Connections>
  • 第二步:找到加密密码,然后添加到 PHP 程序中运行破解

在导出的 connections.ncx 文件中找到 Password ,然后复制到下面 PHP 代码中。( 在 decode=navicatPassword->decrypt('复制出来的密码'); )

代码块 5 解码程序¶
<?php
class NavicatPassword
{
    protected $version = 0;
    protected $aesKey = 'libcckeylibcckey';
    protected $aesIv = 'libcciv libcciv ';
    protected $blowString = '3DC5CA39';
    protected $blowKey = null;
    protected $blowIv = null;
     
    public function __construct($version = 12)
    {
        $this->version = $version;
        $this->blowKey = sha1('3DC5CA39', true);
        $this->blowIv = hex2bin('d9c7c3c8870d64bd');
    }
     
    public function encrypt($string)
    {
        $result = FALSE;
        switch ($this->version) {
            case 11:
                $result = $this->encryptEleven($string);
                break;
            case 12:
                $result = $this->encryptTwelve($string);
                break;
            default:
                break;
        }
         
        return $result;
    }
     
    protected function encryptEleven($string)
    {
        $round = intval(floor(strlen($string) / 8));
        $leftLength = strlen($string) % 8;
        $result = '';
        $currentVector = $this->blowIv;
         
        for ($i = 0; $i < $round; $i++) {
            $temp = $this->encryptBlock($this->xorBytes(substr($string, 8 * $i, 8), $currentVector));
            $currentVector = $this->xorBytes($currentVector, $temp);
            $result .= $temp;
        }
         
        if ($leftLength) {
            $currentVector = $this->encryptBlock($currentVector);
            $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
        }
         
        return strtoupper(bin2hex($result));
    }
     
    protected function encryptBlock($block)
    {
        return openssl_encrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
    }
     
    protected function decryptBlock($block)
    {
        return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
    }
     
    protected function xorBytes($str1, $str2)
    {
        $result = '';
        for ($i = 0; $i < strlen($str1); $i++) {
            $result .= chr(ord($str1[$i]) ^ ord($str2[$i]));
        }
         
        return $result;
    }
     
    protected function encryptTwelve($string)
    {
        $result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
        return strtoupper(bin2hex($result));
    }
     
    public function decrypt($string)
    {
        $result = FALSE;
        switch ($this->version) {
            case 11:
                $result = $this->decryptEleven($string);
                break;
            case 12:
                $result = $this->decryptTwelve($string);
                break;
            default:
                break;
        }
         
        return $result;
    }
     
    protected function decryptEleven($upperString)
    {
        $string = hex2bin(strtolower($upperString));
         
        $round = intval(floor(strlen($string) / 8));
        $leftLength = strlen($string) % 8;
        $result = '';
        $currentVector = $this->blowIv;
         
        for ($i = 0; $i < $round; $i++) {
            $encryptedBlock = substr($string, 8 * $i, 8);
            $temp = $this->xorBytes($this->decryptBlock($encryptedBlock), $currentVector);
            $currentVector = $this->xorBytes($currentVector, $encryptedBlock);
            $result .= $temp;
        }
         
        if ($leftLength) {
            $currentVector = $this->encryptBlock($currentVector);
            $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
        }
         
        return $result;
    }
     
    protected function decryptTwelve($upperString)
    {
        $string = hex2bin(strtolower($upperString));
        return openssl_decrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
    }
};
 
 
//需要指定版本两种,11或12
//$navicatPassword = new NavicatPassword(11);
//这里我指定的12的版本,原先指定的11,执行之后的密码是乱码
$navicatPassword = new NavicatPassword(12);
 
//解密
//$decode = $navicatPassword->decrypt('15057D7BA390');
$decode = $navicatPassword->decrypt('复制出来的密码');
echo $decode."\n";
?>

如果自己没有运行 PHP 的环境,那么可以直接到网上找在线运行程序的网站,例如 https://tool.lu/coderunner ,或者直接 百度-代码在线运行

Linux Mysql8.0+数据库密码重置办法¶

前提:mysql 部署在在自己的 Linux 服务器。

  • 关闭 mysql 服务

    • systemctl stop mysqld

  • 找到 my.cnf mysql的配置文件

    • find / -name my.cnf

  • 到达配置文件目录,进入编辑模式 vim my.cnf

  • 在文件末尾加入 skip-grant-tables

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
skip-grant-tables
  • 重新开启 mysql 服务

    • systemctl start mysqld

  • 进入 mysql ,不用输入密码直接回车进入。

    • mysql -u root -p, 回车进入,然后不输入密码再回车,即可进入 mysql。

  • use mysql; , 然后执行命令清空指定用户的密码 update user set authentication_string="" where user = "root";

  • 退出 mysql , 然后重新编辑 my.cnf 文件,将 skip-grant-tables 注释或删除掉。

  • 重启 mysql , systemctl restart mysqld;

  • 进入 mysql ,不用输入密码直接回车进入。

    • mysql -u root -p, 回车进入,然后不输入密码再回车,即可进入 mysql。

  • 重置指定用户密码,alter user 'root'@'localhost' identified by 'NewPassword';

上一页

常用软件的实用快捷键

© Copyright 2021, Eugene Forest.