G
G
Grisha Nadezhin2021-07-26 16:41:08
linux
Grisha Nadezhin, 2021-07-26 16:41:08

How to delete contents of MySQL database?

Hello everyone, I need to delete ALL CONTENT from the database on linux, while I want to leave the database itself, what command can I do this with?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Akina, 2021-07-26
@Akina

The simplest thing is to make a backup of only the structure, without data ( mysqldump --no-data , https://dev.mysql.com/doc/refman/8.0/en/mysqldump.... ), delete the database, restore. Of course, don't forget to back up procedures/triggers/etc.

S
Sanes, 2021-07-26
@Sanes

It's easier to recreate the database. Otherwise, delete/clear each table separately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question