Linked Questions

23 votes
2 answers
59k views

How to delete all the tables in a MySQL database? [duplicate]

Possible Duplicate: Truncate all tables in a MySQL database in one command? I need to delete, or drop, all the tables in a MySQL database with single command without knowing the tablenames. Is ...
deepa's user avatar
  • 465
0 votes
3 answers
2k views

SQL statement to truncate all data from all tables in the database [duplicate]

Possible Duplicate: Truncate all tables in a MySQL database in one command? how to delete all the data from all tables in the database.
Yajuvendra Vant's user avatar
-1 votes
1 answer
510 views

How can you remove all records from a mysql database? [duplicate]

I have a database with about 50 tables having data in all but I want to remove those records so the database is like new, is there a way to do this or is there a way to extract the tables without the ...
segawe's user avatar
  • 35
1 vote
1 answer
505 views

How to delete all data from any database in MySQL while retaining database structure? [duplicate]

I want to delete all the data from one database but the structure of the table needs to be there. What will be the cleanest way to do that?
Shail Panchal's user avatar
0 votes
0 answers
63 views

Remove all entries in all tables with one query [duplicate]

Is there a single SQL statement that I can use to delete all the entries from a database? I want an SQL statement equivalent to running the DELETE FROM tbl_name; on all the tables in the database. ...
Forrest Keppler's user avatar
0 votes
0 answers
57 views

How do I delete all rows from all tables in a database from MySQL? [duplicate]

I have a database in my mysql. Inside are tables with each name an email address. Each table has the same structure. So something like data (database) [email protected] (table name) [column 1] [...
thecodingmate's user avatar
0 votes
0 answers
50 views

Truncating all tables in MySQL database [duplicate]

I want to execute this MySQL command: mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done Whenever I do so, I receive the following ...
ganesh kumar's user avatar
0 votes
0 answers
25 views

How can i set all 'id' columns in my database in all table to autoincrement? [duplicate]

How can i set all 'id' columns in my database in all table to autoincrement in one query? is there a query that i can use?
flochristos's user avatar
937 votes
17 answers
790k views

How can foreign key constraints be temporarily disabled using T-SQL?

Are disabling and enabling foreign key constraints supported in SQL Server? Or is my only option to drop and then re-create the constraints?
Ray's user avatar
  • 194k
237 votes
5 answers
668k views

How to remove all MySQL tables from the command-line without DROP database permissions? [duplicate]

How do I drop all tables in Windows MySQL, using command prompt? The reason I want to do this is that our user has access to the database drops, but no access to re-creating the database itself, for ...
Mantas's user avatar
  • 3,249
24 votes
7 answers
37k views

Drop all stored procedures in MySQL or using temporary stored procedures

Is there a statement that can drop all stored procedures in MySQL? Alternatively (if the first one is not possible), is there such thing as temporary stored procedures in MySQL? Something similar to ...
Kenston Choi's user avatar
  • 2,952
13 votes
7 answers
25k views

truncate all table in mysql database

Is it possible to truncate all table in mysql database ? what is query for that .
chetan's user avatar
  • 3,263
2 votes
2 answers
7k views

How to empty mysql database in phpmyadmin

I would like to empty a mysql database in phpmyadmin by deleting all tables, however this generates foreign key errors. One solution would be to delete the tables in the right order to prevent ...
Hans's user avatar
  • 568
1 vote
1 answer
5k views

How can I remove all tables from mySQL database with phpAdmin?

I need a simple command to remove all tables in my database. Couldn't find it nowhere. Something like DELETE ALL TABLES of `db1231123`
peace_love's user avatar
  • 6,513
1 vote
2 answers
6k views

mySQL: command to truncate all tables

I am using MySQL. What is the mysql command to truncate all tables of my database? I mean what is the mysql command which empty all tables in my DB not drop all tables.
Leem.fin's user avatar
  • 42.9k

15 30 50 per page