今天开始通过自学MySQL总结一些方法和一些基础的内容,写在这里,和大家一起讨论学习进步。(现在东西少,第一次写有这类结构的东西,过几天会出一个整体目录结构,方便查看)
启动:net start mysql57
关闭:net stop mysql57
启动:[root@localhost ~]service mysql start
关闭:[root@localhost ~]service mysql stop
cd到mysql安装的bin目录下:
C:\Windows\system32>cd C:\Program Files\MySQL\MySQL Server 5.7\bin
连接mysql服务器:
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
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>
mysql> create database orderManage;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cluster |
| mysql |
| test |
| orderManage|
+--------------------+ 5 rows in set (0.00 sec)
选择进入orderManage数据库中:
mysql> use ordermanage;
Database changed
由此可以发现,选择进入数据库时候,数据库的名称是不区分大小写的
mysql> show tables;
Empty set (0.00 sec)
此时,显示orderManage数据库中是没有表的(Empty set表示操作结果为空)
mysql> drop database ordermanage;
Query OK, 0 rows affected (0.01 sec)
原文:https://www.cnblogs.com/19930521zhang/p/14754193.html