众所周知,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('Could not connect: ' . mysql_error()); } echo 'Connected successfully<br />'; $sql = 'DROP DATABASE TUTORIALS'; $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not delete database: ' . mysql_error()); } echo "Database TUTORIALS deleted successfully
"; mysql_close($conn); ?> </body> </html>
以上就是我们如何使用PHP脚本删除MySQL数据库?的详细内容,更多请关注php中文网其它相关文章!
已抢65891个
抢已抢32638个
抢已抢18178个
抢已抢9054个
抢已抢11774个
抢已抢24766个
抢