mysql重置密码
1.命令行进入安装mysql的bin目录下;
2.执行mysqld --skip-grant-tables命令跳过登录验证;
3.执行msyql命令无需密码登录;
4.执行show databases;命令查询所有数据库;
5.使用名称为“mysql”的数据库(use mysql;);
6.执行show tables;sql语句查询“mysql”数据库下的所有表;
7.执行select user,host,authentication_string from user;查询用户名和密码;
8.执行update user set password=password('你的密码') where user='root' and host='localhost';语句更改root密码;
以上方法改密码会出现结束mysql进程后,第二次再进行登录会报错(权限问题),解决方法如下:
1.执行net start mysql 开启mysql数据库服务;
2.执行alter user 'root'@'localhost' identified by '自己的密码'; 修改密码;
3.执行flush privileges;命令刷新权限;
4.执行help contents命令查询修改信息;
5.弹出信息如下,则成功:
You asked for help about help category: "Contents"
For more information, type 'help <item>', where <item> is one of the following
categories:
Account Management
Administration
Compound Statements
Data Definition
Data Manipulation
Data Types
Functions
Functions and Modifiers for Use with GROUP BY
Geographic Features
Help Metadata
Language Structure
Plugins
Procedures
Storage Engines
Table Maintenance
Transactions
User-Defined Functions
Utility
mysql>
上一篇: Oracle表空间扩容
推荐阅读
-
MYSQL命令行模式管理MySql的一点心得_MySQL
-
[MySQL FAQ]启用SELinux后,PHP连接MySQL异常
-
JBuilder2005实战JSP之特殊页面(5)_MySQL
-
MySQL 1130异常,无法远程登录解决方案详解
-
在Win2003(64位)中配置IIS6+PHP5.2.17+MySQL5.5的运行环境,php5.2.17mysql5.5
-
PHP访问MySql数据库 中级篇 Smarty技术
-
Centos5.5中安装Mysql5.5过程分享_MySQL
-
iPhone13手机如何设置锁屏密码?iPhone13设置锁屏密码的方法
-
PHP+MySQL视频教程_PHP教程
-
函数:MySQL中取整函数round和floor_MySQL