ecshop安装检测本地mysql服务器_ecshop本地测试,数据库问题

重置ROOT密码:

1、编辑MySQL的配置文件:my.ini

一般在MySQL安装目录下有my.ini即MySQL的配置文件。

在此配置文件的最后添加如下一行:

skip-grant-tables

保存退出编辑。

2、然后重启MySQL服务

在命令行下执行:

net stop MySQL

net start MySQL

3、设置新的ROOT密码

然后再在命令行下执行:

MySQL -u root -p MySQL或mysql -u root -p

直接回车无需密码即可进入数据库了。

此时,在命令行下执行 use mysql;

现在我们执行如下语句把root密码更新为:

update user set password=PASSWORD("root") where user='root';

(注意:此时不用使用mysqladmin -u root -p password '你的新密码'这条命令修改密码,因为'skip-grant-tables'配置,

不信的话,你可以试用一下,它肯定会报如下所示的错误:

F:\Documents and Settings\long>mysqladmin -u root -p password 'root'

Enter password:

Warning: single quotes were not trimmed from the password by your command

line client, as you might have expected.

mysqladmin:

You cannot use 'password' command as mysqld runs

with grant tables disabled (was started with --skip-grant-tables).

Use: "mysqladmin flush-privileges password '*'" instead)

exit 退出MySQL。

4、还原配置文件并重启服务

然后修改MySQL配置文件把刚才添加的那一行'skip-grant-tables'删除。

再次重起MySQL服务,密码修改完毕。

用新密码root试一下吧,又能登入重新进入mysql了?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值