Home >Database >Mysql Tutorial >Detailed explanation on clearing MySQL database cache and changing forum password

Detailed explanation on clearing MySQL database cache and changing forum password

零下一度
零下一度Original
2017-05-13 16:36:252924browse

Log in to the database of Discuz Forum and execute the following MySQL commands:

[root@test1 control]# mysql -uroot -p
MySQL [(none)]> show databases;

Use the database of Discuz Forum

mysql> use discuzdb;
mysql> show tables;

View the table structure in the database of Discuz Forum

mysql> desc pre_ucenter_members;

QueryDiscuz forum administrator account login password

mysql> mysql> select * from pre_ucenter_members where username="admin";

Set a new password and use md5 to generate a key

mysql> select md5("newpassword");
+----------------------------------+
| md5("newpassword")                |
+----------------------------------+
| da0ad52378e990f8e35b0f9d73b9961d |
+----------------------------------+

According to the md5 value set above, change the password of the forum administrator user

mysql> up
date
 pre_ucenter_members 
set
 password="da0ad52378e990f8e35b0f9d73b9961d" where username="admin";

Next, clean up the cache of MySQL database

mysql> flush hosts;
Query OK, 0 rows affected (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.04 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> flush tables;
Query OK, 0 rows affected (0.01 sec)
mysql> flush status;
Query OK, 0 rows affected (0.00 sec)
mysql> flush tables;
Query OK, 0 rows affected (0.00 sec)
mysql> flush status;
Query OK, 0 rows affected (0.00 sec)

and then , now log in to the forum, enter the user name admin, new password, you can log in successfully

The method of clearing the cache mainly uses the flush command. In order to execute FLUSH, you must have reload permission

flush hosts is mainly used to clear the host cache table

flush logs is mainly used to close the current binary log file and create a new file

flush privileges is mainly used to update the host cache table after re-authorization. Just in case, let the new permissions take effect immediately

flush tables mainly closes all open tables, and this operation will clear the contents of the query cache

flush tables with read lock mainly closes All open tables add a read lock to all tables in the database at the same time

flush status resets most statusVariables to 0

flush master deletes all binary log files in the binary log index file

flush query cacheReorganizes the query cache to eliminate fragments and improve performance

flush slave is similar to resetting replication, allowing Forgot the replication location of the master database from the database

[Related recommendations]

1. Special recommendation:"php program "Employee Toolbox" V0.1 version download

2. Free mysql online video tutorial

##3.

Database design those things

The above is the detailed content of Detailed explanation on clearing MySQL database cache and changing forum password. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn