mysql数据库软件实际上是绿色的,重装系统后能够继续使用。

1、重装系统保留原有的后mysql安装文件夹,数据文件夹。

2、制作用于启动一个批处理文件mysql:【run.bat】的文件存储在mysql安装文件夹bin下。

mysqld.exe --defaults-file=../my-default.ini --console

3、运行run.bat就可以。

假设连接数据库时出现下面错误:"Access denied for user'root'@'IP'"

1. 管理员登陆系统,停止mysql服务或者结束mysqld进程

2. 进入命令行,来到mysql的安装文件夹.如果安装文件夹为 d:\mysql\ , CMD进入命令行

3. 执行 d:\mysql\bin\mysqld-nt --skip-grant-tables 启动mysql,关闭权限的检查

4. 执行 d:\mysql\bin\mysqladmin -u root flush-privileges password "newpassword" 重设root密码

5. 又一次启动mysql服务

Linux系统下能够採用下面方式:

方法一:  

# /etc/init.d/mysql stop  

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &  

# mysql -u root mysql  

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;  

mysql> FLUSH PRIVILEGES;  

mysql> quit  

# /etc/init.d/mysql restart  

# mysql -uroot -p  

Enter password: <输入新设的密码newpassword>  

mysql>  

方法二:  

直接使用/etc/mysql/debian.cnf文件里[client]节提供的username和password:  

# mysql -udebian-sys-maint -p  

Enter password: <输入[client]节的密码>  

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;  

mysql> FLUSH PRIVILEGES;  

mysql> quit  

# mysql -uroot -p  

Enter password: <输入新设的密码newpassword>  

mysql>



版权声明:本文博主原创文章,博客,未经同意不得转载。

[mysql]刷新windows恢复后mysql和&quot;Access denied for user&#39;root&#39;@&#39;IP&#39;&quot;处理问题的更多相关文章

  1. mySQL 5.7版 解决密码登录失败Access denied for user 'root'@'localhost' (us

    mySQL 5.7版 解决密码登录失败Access denied for user 'root'@'localhost' (us             2016-03-05              ...

  2. Linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) "

    前言 作者在2021-07-21时遇到 linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localh ...

  3. Mysql忘记密码:关于ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)的问题

    命令行登录mysql时,出现ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)的提示. ...

  4. MySQL在登陆时出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)错误

    错误显示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决方案: 1.找到配 ...

  5. mysql登录报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问 对于出现拒绝访问root用户的解决方案错 ...

  6. 一个本地DNS解析和mysql授权导致的Mysq连接失败问题(Access denied for user 'loan'@'kfcsdb1' (using password: YES))

    web:/home/web/ -u loan -p loan Enter password: ERROR 1045 (28000): Access denied for user 'loan'@'kf ...

  7. CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法

    1.停用mysql服务:# /etc/rc.d/init.d/mysqld stop 2.输入命令:# mysqld_safe --user=mysql --skip-grant-tables --s ...

  8. MySQL密码正确却无法本地登录-1045 Access denied for user 'root'@'localhost' (using password:YES

    MySQL密码正确却无法本地登录 报错如下: ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password ...

  9. TortoiseGit拉取或推送,输入账号密码后提示 HTTP Basic: Access denied fatal: Authentication failed 解决方案

    TortoiseGit拉取或推送项目,输入账号密码后,提示 HTTP Basic: Access denied fatal: Authentication failed. 大体意思是,HTTP基本认证 ...

随机推荐

  1. SecureCRT 6.7.1 RI和谐 皴 补丁 方法

    它之前被使用SecureCRT 6.5.3 版本号,咋看和谐补丁,即使中国版本也可(现在才发现SecureCRT.6.2.0) 可是换为 6.7.1 后就怎么也注冊不了了.. 没办法试了各种办法: 先 ...

  2. Nagios显示器mysql定从库: libmysqlclient.so.18: cannot open shared object file: No such

    做mysql的slave时间监控,必须check_mysql文字,check当误差: error while loading shared libraries: libmysqlclient.so.1 ...

  3. 最大公约数(Greatest Common Divisor)

    两个数的最大公约数.一个典型的解决方案是欧几里德,叫欧几里德算法. 原理:(m,n)代表m和nGCD,和m>n.然后,(m,n)=(n,m%n)=.....直到余数为0. 码如下面: publi ...

  4. [精华]Hadoop,HBase分布式集群和solr环境搭建

    1. 机器准备(这里做測试用,目的准备5台CentOS的linux系统) 1.1 准备了2台机器,安装win7系统(64位) 两台windows物理主机: 192.168.131.44 adminis ...

  5. 11gR2 Database Services for &quot;Policy&quot; and &quot;Administrator&quot; Managed Databases (文件 ID 1481647.1)

    In this Document   _afrLoop=1459311711568804&id=1481647.1&displayIndex=6&_afrWindowMode= ...

  6. hdu 4856 Tunnels(bfs+状态压缩)

    题目链接:hdu 4856 Tunnels 题目大意:给定一张图,图上有M个管道,管道给定入口和出口,单向,如今有人想要体验下这M个管道,问最短须要移动的距离,起点未定. 解题思路:首先用bfs处理出 ...

  7. 【iOS】Swift扩展extension和协议protocol

    加上几个关节前Playground摘要码进入github在,凝视写了非常多,主要是为了方便自己的未来可以Fanfankan. Swift语法的主要部分几乎相同的. 当然也有通用的.运算符重载.ARC. ...

  8. sqlserver缓存程序-只能使用一次清除缓存计划

    plan cache非常大.将仅仅使用一次的缓存计划清除,而不用清除整个cache. declare @sid varbinary(64) declare cur01 cursor for selec ...

  9. 如何获得 oracle RAC 11g asm spfile S档

     方法一: [root@vmrac1 ~]# su - grid [grid@vmrac1 ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 ...

  10. 打印到类阵列的给定序列的所有排列的n皇后问题

    题目例如以下:Given a collection of numbers, return all possible permutations. For example, [1,2,3] have th ...