我们大家都知道MySQL修改用户密码这一问题一直是困扰新手的一个恶魔,在此问题的解决上新手经常会上范错误,而导致最终不能进入MySQL数据库,所以以下就是几个相关例子的介绍,不知道各位对MySQL的认识是不是更上一层楼了,时时关注IT *** ,学习最新Mysql技术。
1、原来的密码是123456
C:>type MySQL5.bat @echo off MySQL -uroot -p123456 -P3306
正确的修改MySQL用户密码的格式是:
我们这里用
用户:root(可以换成其他的)
密码:woshiduide
来演示新密码。
C:>MySQLadmin -uroot -p password woshiduide Enter password: ******
于是修改成功。注意PASSWORD关键字后面的空格有好多人是这样修改的:
C:>MySQLadmin -uroot -p password ‘woshiduide’ Enter password: ****** C:>MySQLadmin -uroot -p password ‘woshiduide’ Enter password: ********* Warning: single quotes were not trimmed from the password by your command line client, as you might have expected.
而这个时候真正的密码是’woshiduide’
C:>MySQL -uroot -p’woshiduide’ Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 18 Server version: 5.1.17-beta-community-nt-debug MySQL Community Server (GPL) Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer. MySQL>
MySQL修改用户密码实际操作中而新手往往这样:
C:>MySQL -uroot -pwoshiduide ERROR 1045 (28000): access denied for user ‘root’@'localhost’ (using password: Y ES)
所以非常郁闷,BAIDU、GOOGLE的搜了一大堆。
我现在把密码改回去。
C:>MySQLadmin -uroot -p’woshiduide’ password 123456
2、还有就是可以直接进入MySQL,然后修改密码。
MySQL> use MySQL Database changed MySQL> update user set PASSWORDPASSWORD = PASSWORD(‘woshiduide’) where USER=’root’ and H OST=’localhost’; Query OK, 1 row affected (0.05 sec) Rows matched: 1 Changed: 1 Warnings: 0 MySQL> flush privileges; MySQL> exit Bye C:>MySQL -uroot -pwoshiduide Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 23 Server version: 5.1.17-beta-community-nt-debug MySQL Community Server (GPL) Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer. MySQL> Query OK, 0 rows affected (0.02 sec)
3、还有一种就是用SET PASSWORD 命令修改:
C:>MySQL5.bat Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 8 Server version: 5.1.17-beta-community-nt-debug-log MySQL Community Server (GPL) Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer. MySQL> set password for chinastor.com-root@’localhost’ = password(‘woshiduide’); Query OK, 0 rows affected (0.02 sec) MySQL> flush privileges; Query OK, 0 rows affected (0.09 sec) MySQL> exit Bye
4、GRANT 也可以,不过这里不介绍。因为涉及到权限的问题。
上面说了这么多内容,是关于对MySQL修改用户密码的介绍,不知道各位对MySQL的认识是不是更上一层楼了,时时关注IT *** ,学习最新Mysql技术。
对于Windows 7系统来说,其默认安装的许多工具是我们很少使用或从来不用的,比如系统自带的扫雷、纸牌游戏等。删除此类长期不用的系统组件,不但可以让系统更清爽,更重要的是还可以提高系统的运行速度,特别是对于硬件配置相对较低的上网本来说,尤其如此。接下来,笔者就给大家介绍一下如何删除Windows...
我一个朋友最近装装了Windows 7,他总感觉有人用了他的电脑,但是一直不确定,他想知道有没有人动用他的电脑,问我有没有办法 我说设置一下就行了: 启动Windows 7,在搜索栏中输入编辑组,马上就搜索到了编辑组策略,点击即可启动程序编辑组策略。依次展开组策略左侧树形列表的计算机配置/管理模...
故障现象: Windows 7酷狗软件无声音,系统声音正常。 原因分析: 1. 查看酷狗软件设置 2. 查看系统设置 解决方案: 1. Windows 7操作方法 如图:查看是否处于禁音状态 Windows 7系统声音正常酷狗音乐无声音 2. 查看设置音频输出是否...
Ubuntu挂载U盘问题 复制代码代码如下: 老是说special device /dev/sdb1 does not exist,无比郁闷 复制代码代码如下:#fdisk /dev/sda 复制代码代码如下: 是有个 这个咚咚。。。。 复制代码代码如下: 最后: 复制代码代码如下:...
每一位用户的Windows 7系统上,或多或少都会有一到两个自己常用的文件夹,那么如何将这些常用的文件夹添加到任务栏上,增加我们的工作效率呢 许多用户只知道移动exe程序文件到任务栏,却不知道文件夹怎么移,下面小编通过图文教程来告诉大家方法。 操作方法: 1、首先将你使用频率最高的那个文件夹重命...
一些Windows 7用户在升级sp1的时候,出现了黑屏问题,黑屏错误代码0xc0000034提示,这个问题该怎么修复呢?今天小编为大家提供两种解决的方法。 Windows 7 sp1系统出现黑屏解决方法一: 在电脑开机的时候按下键盘上的F8,进入Windows 7安全模式界面,然后选择高级...