next up previous contents
Next: PHP 產生資料表 Up: Tables 資料表 Previous: 命令產生資料表   Contents   DYWANG_HOME

命令刪除資料表

  1. 登入 mariadb。
    [root@kvm8 ~]# mycli -S /var/lib/mysql/mysql.sock -uroot -p123qwe
    mariadb 10.3.11-MariaDB
    mycli 1.20.1
    Chat: https://gitter.im/dbcli/mycli
    Mail: https://groups.google.com/forum/#!forum/mycli-users
    Home: http://mycli.net
    Thanks to the contributor - Jonathan Slenders
    
  2. 使用資料庫 dyw。
    mariadb root@localhost:(none)> use dyw;                                         
    You are now connected to database "dyw" as user "root"
    Time: 0.001s
    
  3. 刪除資料表 tbl。
    mariadb root@localhost:dyw> drop table tbl;                                     
    You're about to run a destructive command.
    Do you want to proceed? (y/n): y
    Your call!
    Query OK, 0 rows affected
    Time: 0.129s
    
  4. 查看資料表,沒有任何資料表。
    mariadb root@localhost:dyw> show tables;                                        
    +---------------+
    | Tables_in_dyw |
    +---------------+
    0 rows in set
    Time: 0.021s
    
  5. 退出 mariadb。
    mariadb root@localhost:dyw> quit;                                               
    Goodbye!
    



De-Yu Wang 2020-04-07