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
[[email protected] ~]# 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學習總結----數據庫相關操作