[ root@lamp ~] # /usr/local/mysql/bin/mysql -uroot -p'admin123'
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is two
Server version : 5.6.16 Source distribution
Copyright (c) 2000, 2014, Oracle and / or its affiliates. All rights reserved.
mysql > create database byrd_default; #Suggest a database called byrd_default
Query OK, one row affected (0.08 sec)
mysql > show databases like 'byrd%' ; #View the database starting with byrd,
+------------------+
| Database (byrd%) |
+------------------+
| byrd_default |
+------------------+
one row in set (0.00 sec)
mysql > show create database byrd_default; #View the byrd_default command created by the system. The default code of byrd_default is utf8, because the default code I set when compiling mysql is utf8
+--------------+-----------------------------------------------------------------------+
| Database | Create Database |
+--------------+-----------------------------------------------------------------------+
| byrd_default | CREATE DATABASE `byrd_default` /*! 40100 DEFAULT CHARACTER SET utf8 */ |
+--------------+-----------------------------------------------------------------------+
one row in set (0.00 sec)
mysql > create database gbk default character set gbk collate gbk_chinese_ci; #Create a database called gbk and encoded in gbk
Query OK, one row affected (0.00 sec)
mysql > show create database gbk;
+----------+-------------------------------------------------------------+
| Database | Create Database |
+----------+-------------------------------------------------------------+
| gbk | CREATE DATABASE `gbk` /*! 40100 DEFAULT CHARACTER SET gbk */ |
+----------+-------------------------------------------------------------+
one row in set (0.00 sec)
mysql > show databases ; #All database tables
+--------------------+
| Database |
+--------------------+
| information_schema |
| byrd_default |
| gbk |
| gbk1 |
| gbk2 |
| gbk3 |
| gbk4 |
| mysql |
| performance_schema |
| test |
| ultrax |
+--------------------+
eleven rows in set (0.00 sec)
mysql > drop database gbk1; #Delete the database named gbk1
Query OK, zero rows affected (0.19 sec)
mysql > drop database gbk2;
Query OK, zero rows affected (0.00 sec)
mysql > drop database gbk3;
Query OK, zero rows affected (0.00 sec)
mysql > drop database gbk4;
Query OK, zero rows affected (0.01 sec)
mysql > show databases ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| byrd_default |
| gbk |
| mysql |
| performance_schema |
| test |
| ultrax |
+--------------------+
seven rows in set (0.00 sec)
mysql > drop database if exists byrd_default; #If the byrd_default database exists, it will be deleted. If it does not exist, a warning will be prompted
Query OK, zero rows affected (0.00 sec)
mysql > show databases ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| gbk |
| mysql |
| performance_schema |
| test |
| ultrax |
+--------------------+
six rows in set (0.00 sec)
mysql >