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

windows远程服务器数据库的搭建和远程访问(Mysql忘记密码通过Navicat连接记录解密密码)

服务器数据库的搭建和远程访问

mysql数据库安装(详细)

window安装mysql详细流程

路程:重设MySQL5密码,发现远程服务器原本有一个MySQL5,尝试在服务器本地建立连接被拒绝,因为不知道密码。
(1)注意mysql服务名:否则会报错服务名无效。
在这里插入图片描述
(2)MySQL5输入指令跳过密码验证时报错:

mysqld --skip-grant-tables

安装MySQL的时候报这个错误,由于找不到 VCRUNTIME140_1.dll,无法继续执行代码,重新安装程序可能会解决此问题。
解决:根据文章,下载安装Visual C++ 2015-2019 Redistributable,双击。在这里插入图片描述
(我看到有人将这个文件拷贝到mysql/bin 目录下,再次执行。怀疑是mysql目录下缺失这个文件导致的。我这样做了之后,远程服务器崩溃了黑屏了,哈哈哈哈哈,我真哈哈哈,被带去机房重启服务器了,然后被要求换了个服务器安装,那个远程服务器有正常的MySQL,可惜了,没法折腾了~~,好吧今日闯祸到此为止…未来可期)

续:
服务器mysql5连不上,应该是密码的问题,问题是不知道密码
(问题是配置文件ini修改了还是不能通过mysqld --skip-grant-tables指令跳过输入密码)

这个博主好厉害啊啊啊啊,通过Navicat连接过数据库,查历史记录来解密
https://www.cnblogs.com/BKYhailong/p/18080385

在线PHP解密工具换这个,真能解
在这里插入图片描述

<?php
namespace FatSmallTools;
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);}
}use FatSmallTools\NavicatPassword;//需要指定版本,11或12//$navicatPassword = new NavicatPassword(12);$navicatPassword = new NavicatPassword(11);//解密
$decode = $navicatPassword->decrypt('15057D7BA390');
echo $decode."\n";

相关文章:

  • 量化交易之数学与统计学基础2.3——线性代数与矩阵运算 | 线性方程组
  • 加速LLM大模型推理,KV缓存技术详解与PyTorch实现
  • 车辆检测新突破:VFM-Det 如何用大模型提升识别精度
  • Spring 框架中的常见注解讲解
  • Chromium 134 编译指南 - Android 篇:配置depot_tools(四)
  • 工业控制「混合架构」PK大战 —— 神经网络 + MPC vs 模糊 PID+MPC 的场景选型与实战指南
  • vscode 个性化
  • 深入探讨互联网大厂Java核心技术与架构设计
  • C++继承(上)
  • conda管理python环境
  • Walrus 与 Pudgy Penguins 达成合作,为 Web3 头部 IP 引入去中心化存储
  • 字节暑期实习-网络运维工程师面经
  • 规划权重和全局优化器逻辑处理
  • Copilot for Excel 一键词云分析与情绪分析
  • 第四部分:实用应用开发
  • C# 类成员的访问:内部与外部
  • 嵌入式开发高频面试题全解析:从基础编程到内存操作核心知识点实战
  • google colab设置python环境为python3.7
  • C++类与对象—上:探索面向对象编程的基石
  • C# 在VS2022中开发常用设置
  • 解放日报:硬科企业由此迈出“市场第一步”
  • 关于“十五五”,在上海召开的这场座谈会释放最新信号
  • 深交所修订创业板指数编制方案,引入ESG负面剔除机制
  • 举牌超200轮!中铁建7.76亿元竞得北京通州梨园宅地
  • 五一假期上海地铁部分线路将延时运营,这些调整请查收
  • 浙江官宣:五一假期,没电、没气、没油车辆全部免费拖离高速