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

How to retrieve user data in MySQL

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

Share

Shulou(Shulou.com)05/31 Report--

What this article shares with you is about how to retrieve user data in MySQL. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Solution process

1. The first thing that comes to mind is to directly retrieve the original user ID from the scheduled backup data. It is found that the system only backed up the records for 10 days, while the workflow system shows that sales C only has the process records after August 3. It has been more than 40 days since now, and it can no longer be recovered from the automatically backed up data.

2. Therefore, it can only be analyzed from the binary records of the database. Enter the directory where the MySQL data is stored:

3. By analyzing the modification time of the file, we know that the action of the deletion operation is recorded in the mysql-bin.000014 file.

4. Because the log file is binary, export the log to a sql file:

Mysqlbinlog-- no-defaults mysql-bin.000014 > workflow_operator.sql

5. The log record is relatively large, with 132m after export. The packaged file is compressed and downloaded locally, which is only 15.2m.

Tar-czvf workflow_operator.tar.gz workflow_operator.sql

6. Use the text tool locally to find all the actions to delete users:

* the action of locating and deleting sales C is on line 127766 (although there are more rows of log records, there are fewer actions to delete users, so it is easy to troubleshoot)

7. User ID was found. Fortunately, because only the user is deleted, the process data is not deleted (because the process data is to be archived), so just replace the old process data user_id of sales C with the new user_id. There are many flow tables. Through manual labor, find the table with the old ID, and then update it together with the update statement, and finally find all the data:

(because of privacy concerns, four people use XXX instead)

Update flow_fr_borrow set user_id = 'e76cb8bccaf74f32b94d17f74437xxxx' where user_id =' 66adfd032ccf428d9e20e864f729xxxexamples; update flow_fr_cost set user_id = 'e76cb8bccaf74f32b94d17f74437xxxx' where user_id =' 66adfd032ccf428d9e20e864f729xxxx; update flow_fr_fixedasset set user_id = 'e76cb8b8bccaf732xxx' where user_id =' 66adfd032cf428d9e20e864f729xxxupdate flow_fr_purchase set user_id; Update flow_fr_travel set user_id = 'e76cb8bccaf74f32b94d17f74437xxxx' where user_id =' 66adfd032ccf428d9e20e864f729xxxexamples; update flow_hr_positive set user_id = 'e76cb8bccaf74f32b94d17f74437xxxx' where user_id =' 66adfd032ccf428d9e20e864f729xxxx; update flow_pr_equip_borrow_sale set user_id = 'e76cb8b8bccaf732xxx' where user_id =' 66adfd032cf428d9e20e864f729xxxupdate flow_sa_tepe set user_id; Update flow_sa_safore set user_id = 'e76cb8bccaf74f32b94d17f74437xxxx' where user_id =' 66adfd032ccf428d9e20e864f729xxxexamples; update flow_sa_authorize set user_id = 'e76cb8bccaf74f32b94d17f74437xxxx' where user_id =' 66adfd032ccf428d9e20e864f729xxxx; update flow_sa_business set user_id = 'e76cb8b8bccaf732xxx' where user_id =' 66adfd032cf428d9e20e864f729xxxupdate wf_hist_order set creator; Update wf_hist_task set operator = 'e76cb8bccaf74f32b94d17f74437xxxxx' where operator = '66adfd032ccf428d9e20e864f729xxxcoffee; update wf_order set creator =' e76cb8bccaf74f32b94d17f74437xxxx' where creator = '66adfd032ccf428d9e20e864f729xxxx; update wf_hist_task_actor set actor_Id =' e76cb8bbccaf729xxxxx; update wf_hist_task_actor set actor_Id = '66adfd032cf032cf032cf428cf428cf729xxxxcompiled above is how to find user data in MySQL. I believe there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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