How to replace the content fields in the database with Trojans SQL injection-mysql tutorial

Source: Internet
Author: User
Sometimes some databases are infected with Trojans. if it is an sqlserver database, you can use the following method. However, this method is suitable for friends who know sqlserver, but friends who do not know can also use it, some databases are replaced by online management programs.

Sometimes some databases are infected with Trojans. if it is an sqlserver database, you can use the following method. However, this method is suitable for friends who know sqlserver, but friends who do not know can also use it, some databases are replaced by online management programs.

Some Trojan fields in sqlsever are cleared. now we summarize the article "replacing database Trojan fields in batches with sqlsever", hoping to help those in need.
[Solution]
1. back up data first to prevent data loss when the Trojan Field is deleted;
2. execute the following statement for the field text in the Trojan-mounted table to be smaller than 8000 (many software and methods on the Internet are aimed at text less than 8000, you can refer to this solution)
The code is as follows: for example, the context Trojan field in the news table is

The code is as follows:
Update news set context = replace (context ,'','')


The Trojan field is cleared after execution.
3. However, some fields, such as content fields and other varchar fields greater than 8000 characters, must be executed.
The code is as follows:
The code is as follows:
Update news set context = replace (cast (context as varchar (8000 )),'','')


4. sometimes, when the amount of information is large, it will lead to a false death for the database. we can add intervals for batch execution and execute 10000 records each time.
The code is as follows:
Update news
Set context = replace (cast (context as varchar (8000 )),'','')
Where id> 1 and id <10000

The above Trojan problems are generally SQL databases, which are unique to SQL databases.
In fact, we filter all database connection requests from the source, and solve the Trojan issue from the database entry. This requires the programmer's program logic to be meticulous.

There are many database management programs in asp, such as db007.
In php, many mature systems have their own batch replacement functions, such as dedecms.
How can I delete objects as quickly as possible?
"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.