重装系统C盘格式化,MYSQL恢复

背景:mysql在E盘,但是C盘重装系统,以前的注册表之类的都没有了,想重新恢复mysql的使用。

  1. 配置以前的环境变量

  2. 按照下面的步骤注册并启动服务

    C:\Users\Administrator>net stop mysql
    没有启动 mysql 服务。

    请键入 NET HELPMSG 3521 以获得更多的帮助。

    C:\Users\Administrator>sc delete mysql
    [SC] DeleteService 成功

    C:\Users\Administrator>E:

    E:>cd /d "E:\Mysql\mysql-5.7.37-winx64\bin"

    E:\MySQL\mysql-5.7.37-winx64\bin>mysqld --install mysql --defaults-file="E:\Mysql\mysql-5.7.37-winx64\my.ini"
    Service successfully installed.

    E:\MySQL\mysql-5.7.37-winx64\bin>net start mysql
    mysql 服务正在启动 .
    mysql 服务已经启动成功。

    E:\MySQL\mysql-5.7.37-winx64\bin>mysql -u root -p
    Enter password: *******
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 2
    Server version: 5.7.37 MySQL Community Server (GPL)

    Copyright (c) 2000, 2022, Oracle and/or its affiliates.

    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>

相关推荐
祈安_7 小时前
C语言内存函数
c语言·后端
Turnip12021 天前
深度解析:为什么简单的数据库"写操作"会在 MySQL 中卡住?
后端·mysql
加号32 天前
windows系统下mysql多源数据库同步部署
数据库·windows·mysql
シ風箏2 天前
MySQL【部署 04】Docker部署 MySQL8.0.32 版本(网盘镜像及启动命令分享)
数据库·mysql·docker
norlan_jame2 天前
C-PHY与D-PHY差异
c语言·开发语言
czy87874752 天前
除了结构体之外,C语言中还有哪些其他方式可以模拟C++的面向对象编程特性
c语言
WeiXin_DZbishe2 天前
基于django在线音乐数据采集的设计与实现-计算机毕设 附源码 22647
javascript·spring boot·mysql·django·node.js·php·html5
m0_531237172 天前
C语言-数组练习进阶
c语言·开发语言·算法
爱可生开源社区2 天前
MySQL 性能优化:真正重要的变量
数据库·mysql
小马爱打代码2 天前
MySQL性能优化核心:InnoDB Buffer Pool 详解
数据库·mysql·性能优化