NameSilo

Want to drop every table in your mysql database?

Spaceship Spaceship
Watch

Wuoshi

Established Member
Impact
8
This script will delete every table in your database, be careful when you use it. I take no responsibility for the loss of data. Enjoy!


<html>

<body>

<?

$username="your_username";
$password="your_password";
$database="your_databse";
$host="your_hostname";

mysql_connect($host, $username, $password);
mysql_select_db($database) or die( "Unable to select database");






$query = "show tables";


$result = mysql_query($query);


while ($Row = mysql_fetch_array ($result))
{
list ($tables) = $Row;


$query2 = "DROP TABLE $tables";


$result2 = mysql_query($query2) or die(mysql_error());

}


?>

</body>
</html>
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Be very careful.

This can make you lose ALL your MySQL records. :p - Just thought I'd point it out incase you run it without thought.

Dan
 
0
•••
Indeed! Only time this would be useful is when you want a clean start and don't want to drop each table manually.
 
0
•••

We're social

Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back