mysql -h localhost -u root -p
mysql> show databases;
+--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sakila | | sys | | world | +--------------------+ 6 rows in set (0.00 sec)
mysql> create database portal;
mysql> show create database portal \G;
*************************** 1. row *************************** Database: portal Create Database: CREATE DATABASE `portal` /*!40100 DEFAULT CHARACTER SET utf8 */ 1 row in set (0.00 sec)
mysql> use portal;
mysql> select database();
+------------+ | database() | +------------+ | portal | +------------+ 1 row in set (0.00 sec)
mysql> drop database portal;
原文:http://www.cnblogs.com/libingql/p/6388360.html