mysql怎么显示、查询现有数据库列表?(show databases;)怎么删除现有数据库?(drop database <库名>)
生活随笔
收集整理的這篇文章主要介紹了
mysql怎么显示、查询现有数据库列表?(show databases;)怎么删除现有数据库?(drop database <库名>)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
顯示所有數據庫
show databases;命令
C:\Users\Dontla>mysql -u root -p Enter password: **** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 8.0.23 MySQL Community Server - GPLCopyright (c) 2000, 2021, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show database; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1 mysql> show databases; +--------------------+ | Database | +--------------------+ | flask_demo | | flask_sql_demo | | information_schema | | mysql | | performance_schema | | sakila | | sys | | world | +--------------------+ 8 rows in set (0.05 sec)mysql>刪除數據庫
drop database <庫名>
mysql> drop database flask_demo; Query OK, 0 rows affected (0.03 sec)mysql> show databases; +--------------------+ | Database | +--------------------+ | flask_sql_demo | | information_schema | | mysql | | performance_schema | | sakila | | sys | | world | +--------------------+ 7 rows in set (0.00 sec)mysql>總結
以上是生活随笔為你收集整理的mysql怎么显示、查询现有数据库列表?(show databases;)怎么删除现有数据库?(drop database <库名>)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Flask学习 视频网站搭建(Pytho
- 下一篇: python3使用SQLALchemy报