English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic Notes on MySQL

View databases

show databases;

Create database

create DATABASE database name

create DATABASE databasetest;

Select database

use 数据库名称

use databasetest;
------------
Database changed; switch successful

View the current database name

SELECT DATABASE();

Delete database

drop DATABASE 数据库名称

drop DATABASE databasetest;

Database status

status;
--------------
mysql Ver 14.14 Distrib 5.7.17, for Win64 (x8664_
)     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 Average queries per second: 0.006
--------------

Statement: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume any relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#w3Please replace '#' with '@' when sending an email for reporting, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.