Dropping the database is potentially a very bad thing to do.Any data stored in the database will be destroyed. Do you really want to drop the "TUTORIALS" database [y/N] yDatabase "TUTORIALS" dropped第二种方法:使用PHP脚本删除数据库

实例
以下实例演示了使用PHP mysql_query函数来删除数据库:
<html><head><title>Deleting MySQL Database</title></head><body><?php$dbhost = "localhost:3036";$dbuser = "root";$dbpass = "rootpassword";$conn = mysql_connect($dbhost, $dbuser, $dbpass);if(! $conn ){ die("连接失败: " . mysql_error());}echo "连接成功<br />";$sql = "DROP DATABASE TUTORIALS";$retval = mysql_query( $sql, $conn );if(! $retval ){ die("删除数据库失败: " . mysql_error());}echo "数据库 TUTORIALS 删除成功
";mysql_close($conn);?></body></html>注意:在使用PHP脚本删除数据库时,不会出现确认是否删除信息,会直接删除指定数据库,所以你在删除数据库时要特别小心。