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 is to delete the library and run away?

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "what is to delete the library and run away". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is to delete the library and run away".

How did you delete the library?

The so-called "delete database run" is actually just a joke, and the specific method of "deleting library" may be to delete the files on the server, empty the contents of the database, delete the database tables, and so on.

Different data are deleted in different ways.

Delete server files

The file deletion of the Linux server is mainly the rm command. The rm command can delete one or more files or directories in a directory, or delete a directory and all its subordinate files and subdirectories.

On Linux, use the rm command with extra care. Because once a file is deleted, it can no longer be restored.

The syntax of the rm command is rm [options] [parameters]

Therefore, when using rm, you must pay close attention to the correctness of [options] [parameters].

Some of the more dangerous options are:

-f: force deletion of files or directories

-r or-R: recursive processing that processes all files under the specified directory with subdirectories

These two are dangerous and may have unintended and irreparable consequences.

In addition, the parameters are also worth noting, some people are used to using rm * to delete files, which is actually very dangerous, because * represents all files, which is very error-tolerant.

The most dangerous thing is to execute it on the server: rm-rf * and, of course, even more dangerous than that: sudo rm-rf /

Special statement: do not believe the contents of this picture, or you will bear the consequences!

Delete database

In addition to deleting the files on the server, there are also some cases where the database is deleted.

The deletion database here includes the deletion of the database and tables.

1. Dorp, drop belongs to the database definition language DDL, which means to delete the table. It can also be used to delete the database and delete the index in the table.

The syntax for deleting a table using drop is: drop table table name

The syntax for deleting a database is: drop database database name

2. Truncate, truncate belongs to the database definition language DDL, which means to delete all data in the table, and the DDL operation is implicitly submitted! Cannot rollback

The syntax for deleting a table using truncate is: truncate from table name

In particular, it is important to note that data deleted using truncate cannot be recovered.

Clear the table contents

In addition to operations on the database and table structures, another way to destroy is to empty the contents of the database.

The delte statement is usually used. Delete belongs to the database manipulation language DML, which means to delete the data in the table.

The delete deletion process deletes one row at a time from the table and saves the row deletion in the log as a transaction record.

When using delete, you can delete all of them or delete them conditionally.

Use delete to delete all data in the table: delete from table name

Delete conditionally using delete: delete from table name where condition

How to avoid erroneous deletion

First of all, for the operator, the most important thing is to be extra careful and check carefully before performing the deletion operation.

For company managers, a better way is to do a good job of authority control, to recover all the permissions that should not be granted, so as to avoid misoperation or malicious operation.

Another important thing is to back up in time! Cold standby and hot standby both!

Thank you for your reading, the above is the content of "what is to delete the library and run away". After the study of this article, I believe you have a deeper understanding of the problem of what is the deletion of the library, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Development

Wechat

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

12
Report