mysql学习笔记之基础知识
查看数据库
showdatabases;
创建数据库
createDATABASE数据库名称
createDATABASEdatabasetest;
选择数据库
use数据库名称
usedatabasetest;
------------
Databasechanged;切换成功
查看当前数据库名称
SELECTDATABASE();
删除数据库
dropDATABASE数据库名称
dropDATABASEdatabasetest;
数据库状态
status; -------------- mysqlVer14.14Distrib5.7.17,forWin64(x86_64) Connectionid:5 Currentdatabase: Currentuser:root@localhost SSL:Notinuse Usingdelimiter:; Serverversion:5.7.17-logMySQLCommunityServer(GPL) Protocolversion:10 Connection:127.0.0.1viaTCP/IP Servercharacterset:utf8 Dbcharacterset:utf8 Clientcharacterset:gbk Conn.characterset:gbk TCPport:3306 Uptime:2hours25min34sec Threads:2Questions:57Slowqueries:0Opens:114Flushtables:1Opentables:107Queriespersecondavg:0.006 --------------