[root@localhost ~]# mysql -u root -p
Enter password:
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis7
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis7
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis7
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis11
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| CESHI |
| MYCESHI |
| mysql |
| performance_schema |
| sys |
+--------------------+6 rows inset (0.00 sec)
mysql> quit;
Bye
[root@localhost ~]# mysqladmin -u root -p drop CESHI
Enter password:
Dropping the database is potentially a very bad thing to do.
Any data stored inthe database will be destroyed.
Do you really want to drop the 'CESHI' database [y/N] y
Database "CESHI" dropped
mysql选择数据库
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis14
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature toget a quicker startup with -A
Database changed
mysql>