mysql忘记root密码的解决方法
方法一: 在windows下: 1.打开命令行(DOS)窗口,停止mysql服务: net stop mysql 2.在DOS下面进入mysql的安装路径下的 bin目录,如 D:\mysql\bin 3. 输入并执行命令: mysqld -nt --skip-grant-tables (次命令执行后该窗口就停住了) 4.另外打开一个命令行窗口
方法一:
在windows下:
1.打开命令行(DOS)窗口,停止mysql服务: net stop mysql
2.在DOS下面进入mysql的安装路径下的 bin目录,如 D:\mysql\bin
3. 输入并执行命令: mysqld -nt --skip-grant-tables
(次命令执行后该窗口就停住了)
4.另外打开一个命令行窗口,执行mysql
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
>exit
例如:
cmd-> cd D:\MySQL\bin
D:\MySQL\bin>mysqld -nt -- skip-grant-tables
另外打开一个命令行窗口,执行mysql
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
>exit
方法二:
windows下忘记mysql超级管理员root密码的解决办法
1,停止MYSQL服务,CMD打开DOS窗口,输入 net stop mysql
2,在CMD命令行窗口,进入MySQL安装目录 比如 d:\MySQL\bin
3,跳过mysql权限检查表,即当mysql起来后,不用输入密码就能进入数据库。
命令为: mysqld-nt --skip-grant-tables
4,重新打开一个CMD命令行窗口,输入mysql -uroot -p,使用空密码的方式登录MySQL(不用输入密码,直接按回车)
5,输入以下命令开始修改root用户的密码
mysql> update mysql.user set password=PASSWORD('新密码') where User='root';
6,刷新权限表
mysql> flush privileges;
7,退出
mysql> quit
解决MySQL的客户端不支持鉴定协议
MySQL 5.1采用了基于密码混编算法的鉴定协议,它与早期客户端(4.1之前)使用的协议不兼容。如果你将服务器升级到4.1之上,用早期的客户端进行连接可能失败,并给出下述消息:
以下为引用的内容: shell> mysql |
客户端不支持服务器请求的鉴定协议:请考虑升级MySQL客户端。
要想解决该问题,应使用下述方法之一:
·升级所有的客户端程序,以使用4.1.1或更新的客户端库。
·用4.1版之前的客户端连接到服务器时,请使用仍具有4.1版之前风格密码的账户。
·对于需要使用4.1版之前的客户端的每位用户,将密码恢复为4.1版之前的风格。可以使用SET PASSWORD语句和OLD_PASSWORD()函数完成该任务:
以下为引用的内容:
http://czy4411741.blog.163.com/blog/static/3420312720081141524734/ http://blog.csdn.net/jz_jhm0516/article/details/6862265
|

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



You can open phpMyAdmin through the following steps: 1. Log in to the website control panel; 2. Find and click the phpMyAdmin icon; 3. Enter MySQL credentials; 4. Click "Login".

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

Redis uses a single threaded architecture to provide high performance, simplicity, and consistency. It utilizes I/O multiplexing, event loops, non-blocking I/O, and shared memory to improve concurrency, but with limitations of concurrency limitations, single point of failure, and unsuitable for write-intensive workloads.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Effective monitoring of Redis databases is critical to maintaining optimal performance, identifying potential bottlenecks, and ensuring overall system reliability. Redis Exporter Service is a powerful utility designed to monitor Redis databases using Prometheus. This tutorial will guide you through the complete setup and configuration of Redis Exporter Service, ensuring you seamlessly build monitoring solutions. By studying this tutorial, you will achieve fully operational monitoring settings

The methods for viewing SQL database errors are: 1. View error messages directly; 2. Use SHOW ERRORS and SHOW WARNINGS commands; 3. Access the error log; 4. Use error codes to find the cause of the error; 5. Check the database connection and query syntax; 6. Use debugging tools.

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.
