Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if I forget my mysql database password?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. steps to crack the password of mysql database

1. Modify mysql configuration file / etc/my.cnf

[mysqld] port = 3306socket = / tmp/mysql.sockskip-external-lockingkey_buffer_size = 256Mmax_allowed_packet = 1Mtable_open_cache = 256sort_buffer_size = 1Mread_buffer_size = 1Mread_rnd_buffer_size = 4Mmyisam_sort_buffer_size = 64Mthread_cache_size = 8queryroomcachesisize= 16M# Try number of CPU's*2 for thread_concurrencythread_concurrency = 2datadir = / mydata/dataskip-grant-tables # add this item

2. Restart mysqld

# / etc/init.d/mysqld restart Stopping MySQL: [OK] Starting MySQL: [OK]

3. Log in and change the root password of MySQL

# / usr/bin/mysql Welcome to the MySQL monitor. Commands end with; or\ g. Your MySQL connection id is 3 to server version: 3.23.56 Type 'help;' or'\ h' for help. Type'\ c'to clear the buffer. Mysql > USE mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with-A Database changed mysql > UPDATE user SET Password = password ('new-password') WHERE User =' root'; Query OK, 0 rows affected (0 sec) Rows matched: 2 Changed: 0 Warnings: 0 mysql > flush privileges; Query OK, 0 rows affected (0 sec) mysql > quit Bye

5. Modify the login settings of MySQL

# vi / etc/my.cnf deletes and saves the skip-grant-tables just added to the paragraph in [mysqld] and exits vi.

6. Restart mysqld

# / etc/init.d/mysqld restart Stopping MySQL: [OK] Starting MySQL: [OK]

The figure shows:

The modifications are as follows:

Reset password:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report