In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to record SQL statements executed by MySQL". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In many cases, we need to know what SQL statements MySQL has executed, such as what harm has been caused after MySQL has been injected, and so on. As long as you have a record of the SQL statement, you can know the situation and make countermeasures. The server can turn on the SQL statement recording function of MySQL, so that the behavior of the client program can be detected indirectly.
The way to open it is simple: edit the / etc/my.cnf file and add: log=/var/lib/mysql/sql_row.log line under the [mysqld] section (the path of the log is defined by yourself as needed).
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). Old_passwords=1 log=/var/lib/mysql/sql_row.log # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
After the modification, remember to restart MySQL:
Service mysql restart # or / etc/init.d/mysqld stop / etc/init.d/mysqld start
Now you should be able to see which programs were executed by MySQL when you went to the sql_row.log file under the / var/lib/mysql/ path.
This is the end of the content of "how to record SQL statements executed by MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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: 291
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.