zoukankan      html  css  js  c++  java
  • 删除数据库

    drop命令用于删除数据库。

    drop命令格式:drop database <数据库名>;

    例如,删除名为 xhkdb的数据库:
    mysql> drop database xhkdb;

    [例子1] 删除一个已经确定存在的数据库:
       mysql> drop database drop_database;
       Query OK, 0 rows affected (0.00 sec)

    [例子2] 删除一个不确定存在的数据库:
        mysql> drop database drop_database;
        ERROR 1008 (HY000): Can't drop database 'drop_database'; database doesn't exist
        // 发生错误,不能删除'drop_database'数据库,该数据库不存在。

        mysql> drop database if exists drop_database;
        Query OK, 0 rows affected, 1 warning (0.00 sec)
        //产生一个警告说明此数据库不存在

        mysql> create database drop_database;  // 创建一个数据库
        Query OK, 1 row affected (0.00 sec)
        mysql> drop database if exists drop_database;  // if exists 判断数据库是否存在,不存在也不产生错误
        Query OK, 0 rows affected (0.00 sec)

  • 相关阅读:
    [BJDCTF 2nd]fake google
    flask之ssti模板注入初窥
    ctfshow-web14
    ctfshow-web 13
    ctfshow-web12
    ctfshow-web 11
    ctfshow-web10
    ctfshow-web9
    python学习笔记(四)- 常用的字符串的方法
    python学习笔记(三)- 字典、集合
  • 原文地址:https://www.cnblogs.com/hanxing/p/4256828.html
Copyright © 2011-2022 走看看