新版MySQL修改密码问题

转http://blog.csdn.net/u013066244/article/details/53008869

修改密码

登录成功后,我想修改密码,使用命令:

update user set password=password('root') where user='root'; 
 
 
  • 1

结果总是提示Unknown column 'password' in 'field list'

原来新版本没有password这个字段了,改成authentication_string

把命令改成

update user set authentication_string=password('root') where user='root'; 
 
 
  • 1

就可以啦

再一次重启后出现如下问题

Your password has expired. To log in you must change it using a client that supports expired passwords

解决办法:
进行MySQL的bin打开cmd

mysqladmin -uroot -p password
 
 

在Enter password:root,这里root是我的密码,也就是通过上面update更新密码。
New password:输入新密码
confirm password:输入确认密码。

这里讲个小知识:在my.ini配置文件中最后加上skip-grant-tables,可以是登录MySQL时,不进行权限认证。(要是没有my.ini,请拷贝my-default.ini,并改名字为my.ini).
my.ini的配置信息:

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
 basedir = D:\Program Files\mysql-5.7.16-winx64
 datadir = D:\Program Files\mysql-5.7.16-winx64\data
 port = 3306
 max_connections=200
 bind-address = 0.0.0.0
# server_id = .....


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
#skip-grant-tables

 
 
  • 1

这篇讲解了MySQL ERROR 1045 (28000): Access denied for user ‘root’@’localhost’
(using password: NO)的真正原因。不过是在Linux环境中。

http://www.cnblogs.com/kerrycode/p/4368312.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值