Mysql刪除數(shù)據(jù)庫dropdatabase詳細(xì)介紹
來源:懂視網(wǎng)
責(zé)編:小采
時間:2020-11-09 20:42:26
Mysql刪除數(shù)據(jù)庫dropdatabase詳細(xì)介紹
Mysql刪除數(shù)據(jù)庫dropdatabase詳細(xì)介紹:Mysql 刪除數(shù)據(jù)庫drop database 方法-:使用cmd模式下載刪除 mysql> drop database school; 此命名刪除了school數(shù)據(jù)庫。但如果school數(shù)據(jù)庫不存在就會報(bào)錯。所以完整的語句應(yīng)該這么寫: mysql> drop database if exis
導(dǎo)讀Mysql刪除數(shù)據(jù)庫dropdatabase詳細(xì)介紹:Mysql 刪除數(shù)據(jù)庫drop database 方法-:使用cmd模式下載刪除 mysql> drop database school; 此命名刪除了school數(shù)據(jù)庫。但如果school數(shù)據(jù)庫不存在就會報(bào)錯。所以完整的語句應(yīng)該這么寫: mysql> drop database if exis

Mysql 刪除數(shù)據(jù)庫drop database
方法-:使用cmd模式下載刪除
mysql> drop database school;
此命名刪除了school數(shù)據(jù)庫。但如果school數(shù)據(jù)庫不存在就會報(bào)錯。所以完整的語句應(yīng)該這么寫:
mysql> drop database if exists school;
方法二:PHP腳本刪除數(shù)據(jù)庫
在php中,我們可以使用mysql_query函數(shù)來執(zhí)行sql語句。 所以刪除數(shù)據(jù)庫時,我們可以直接用mysql_query來執(zhí)行刪除命令。
<?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 successfullyn";
mysql_close($conn);
?>
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
您可能感興趣的文章:
Mysql字符串截取函數(shù)SUBSTRING的用法說明超詳細(xì)mysql left join,right join,inner join用法分析MySQL日期數(shù)據(jù)類型、時間類型使用總結(jié)windows下MySQL5.6版本安裝及配置過程附有截圖和詳細(xì)說明Mysql命令行導(dǎo)入sql數(shù)據(jù)MySQL server has gone away 問題的解決方法MySQL創(chuàng)建用戶與授權(quán)方法mySQL中replace的用法MySQL數(shù)據(jù)庫備份與恢復(fù)方法MySQL提示:The server quit without updating PID file問題的解決辦法
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
Mysql刪除數(shù)據(jù)庫dropdatabase詳細(xì)介紹
Mysql刪除數(shù)據(jù)庫dropdatabase詳細(xì)介紹:Mysql 刪除數(shù)據(jù)庫drop database 方法-:使用cmd模式下載刪除 mysql> drop database school; 此命名刪除了school數(shù)據(jù)庫。但如果school數(shù)據(jù)庫不存在就會報(bào)錯。所以完整的語句應(yīng)該這么寫: mysql> drop database if exis