码迷,mamicode.com
首页 > 数据库 > 详细

MySQL学习总结----数据库相关操作

时间:2017-10-16 09:45:32      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:mysql

MySQL学习总结----数据库相关操作

==========================================================================================

一、MySQL数据库

===================================================================

    MySQL是一个关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司。MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性。

  • 》》》Mysql是开源的,所以你不需要支付额外的费用。

  • 》》》Mysql支持大型的数据库。可以处理拥有上千万条记录的大型数据库。

  • 》》》MySQL使用标准的SQL数据语言形式。

  • 》》》Mysql可以允许于多个系统上,并且支持多种语言。这些编程语言包括C、C++、Python、Java、Perl、PHP、Eiffel、Ruby和Tcl等。

  • 》》》Mysql对PHP有很好的支持,PHP是目前最流行的Web开发语言。

  • 》》》MySQL支持大型数据库,支持5000万条记录的数据仓库,32位系统表文件最大可支持4GB,64位系统支持最大的表文件为8TB。

  • 》》》Mysql是可以定制的,采用了GPL协议,你可以修改源码来开发自己的Mysql系统。


===================================================================

二、创建数据库

===================================================================

1、命令行创建一个名为doublelinux的数据库;

1) 使用linux远程连接工具打开本地mysql1

[root@localhost ~]# mysql -uroot -p

Enter password: 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 24

Server version: 5.5.54 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> 

2) 创建一个名为doublelinux的数据库;


mysql> create database doublelinux;

Query OK, 1 row affected (0.00 sec)


3) 查看当前MySQL数据库下面有哪些数据库;

mysql> show databases;

+--------------------+

| Database             |

+--------------------+

| information_schema |

| doublelinux           |

| mysql                   |

| performance_schema |

| test              |

+--------------------+

6 rows in set (0.00 sec)



===================================================================

三、查看与选择数据库

===================================================================

1、 查看当前MySQL数据库下面有哪些数据库;


mysql> show databases;

+--------------------+

| Database        |

+--------------------+

| information_schema |

| doublelinux     |

| mysql           |

| performance_schema |

| test               |

+--------------------+

6 rows in set (0.00 sec)


2、 选择doublelinux数据库

mysql> use doublelinux;

Database changed


===================================================================

四、删除数据库

===================================================================

1、删除doublelinux数据

mysql> drop database doublelinux;

Query OK, 0 rows affected (0.03 sec)

本文出自 “doublelinux” 博客,谢绝转载!

MySQL学习总结----数据库相关操作

标签:mysql

原文地址:http://doublelinux.blog.51cto.com/12300166/1972548

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!