mysql學習筆記之基礎知識。本站提示廣大學習愛好者:(mysql學習筆記之基礎知識)文章只能為提供參考,不一定能成為您想要的結果。以下是mysql學習筆記之基礎知識正文
查看數據庫
show databases;
創建數據庫
create DATABASE 數據庫名稱
create DATABASE databasetest;
選擇數據庫
use 數據庫名稱
use databasetest;
------------
Database changed;切換成功
查看當前數據庫名稱
SELECT DATABASE();
刪除數據庫
drop DATABASE 數據庫名稱
drop DATABASE databasetest;
數據庫狀態
status; -------------- mysql Ver 14.14 Distrib 5.7.17, for Win64 (x86_64) Connection id: 5 Current database: Current user: root@localhost SSL: Not in use Using delimiter: ; Server version: 5.7.17-log MySQL Community Server (GPL) Protocol version: 10 Connection: 127.0.0.1 via TCP/IP Server characterset: utf8 Db characterset: utf8 Client characterset: gbk Conn. characterset: gbk TCP port: 3306 Uptime: 2 hours 25 min 34 sec Threads: 2 Questions: 57 Slow queries: 0 Opens: 114 Flush tables: 1 Open tables: 107 Queries per second avg: 0.006 --------------