重装系统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>

相关推荐
顶点多余8 分钟前
使用C/C++语言链接Mysql详解
数据库·c++·mysql
C羊驼44 分钟前
C语言:两天打鱼,三天晒网
c语言·经验分享·笔记·算法·青少年编程
Seven972 小时前
MySQL语句执行深度剖析:从连接到执行的全过程
mysql
本喵是FW2 小时前
C语言手记1
java·c语言·算法
总要冲动一次3 小时前
离线安装 percona-xtrabackup-24
linux·数据库·mysql·centos
buhuimaren_4 小时前
MySQL数据库初体验
数据库·mysql
赶路人儿4 小时前
常见的mcp配置
android·adb
J超会运4 小时前
MySQL核心SQL语句速查宝典
数据库·mysql
殷紫川4 小时前
吃透分库分表:分片策略、跨库事务与平滑扩容全解
mysql·架构
殷紫川5 小时前
SQL 性能优化全解:从执行计划到底层逻辑,根治 99% 的慢 SQL 与规范落地
数据库·mysql