成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

Mysql如何創(chuàng)建數(shù)據(jù)庫

小編給大家分享一下MySQL如何創(chuàng)建數(shù)據(jù)庫,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

創(chuàng)新互聯(lián)是一家專業(yè)提供梅河口企業(yè)網(wǎng)站建設(shè),專注與成都網(wǎng)站設(shè)計、成都做網(wǎng)站、H5網(wǎng)站設(shè)計、小程序制作等業(yè)務(wù)。10年已為梅河口眾多企業(yè)、政府機構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)的建站公司優(yōu)惠進(jìn)行中。

4.1 create and drop database

C:\Users\admin>mysql -h localhost -u root -pmysql

mysql: [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 3

Server version: 5.7.14 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> show databases;

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

| Database           |

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

| information_schema |

| mysql              |

| performance_schema |

| sys                |

| test               |

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

5 rows in set (0.00 sec)

mysql> create database example;         #create database

Query OK, 1 row affected (0.04 sec)

mysql> show databases;                #顯示databases

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

| Database           |

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

| information_schema |

| example            |

| mysql              |

| performance_schema |

| sys                |

| test               |

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

6 rows in set (0.00 sec)

mysql> drop database example;              #drop database;

Query OK, 0 rows affected (0.04 sec)

mysql> show databases;

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

| Database           |

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

| information_schema |

| mysql              |

| performance_schema |

| sys                |

| test               |

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

5 rows in set (0.00 sec)

mysql> create database mysql;

ERROR 1007 (HY000): Can't create database 'mysql'; database exists

mysql> create database mydata;

Query OK, 1 row affected (0.01 sec)

4.2 存儲引擎

mysql> show engines \G

*************************** 1. row ***************************

      Engine: InnoDB

     Support: DEFAULT

     Comment: Supports transactions, row-level locking, and foreign keys

Transactions: YES

          XA: YES

  Savepoints: YES

*************************** 2. row ***************************

      Engine: MRG_MYISAM

     Support: YES

     Comment: Collection of identical MyISAM tables

Transactions: NO

          XA: NO

  Savepoints: NO

*************************** 3. row ***************************

      Engine: MEMORY

     Support: YES

     Comment: Hash based, stored in memory, useful for temporary tables

Transactions: NO

          XA: NO

  Savepoints: NO

*************************** 4. row ***************************

      Engine: BLACKHOLE

     Support: YES

     Comment: /dev/null storage engine (anything you write to it disappears)

Transactions: NO

          XA: NO

  Savepoints: NO

*************************** 5. row ***************************

      Engine: MyISAM

     Support: YES

     Comment: MyISAM storage engine

Transactions: NO

          XA: NO

  Savepoints: NO

*************************** 6. row ***************************

      Engine: CSV

     Support: YES

     Comment: CSV storage engine

Transactions: NO

          XA: NO

  Savepoints: NO

*************************** 7. row ***************************

      Engine: ARCHIVE

     Support: YES

     Comment: Archive storage engine

Transactions: NO

          XA: NO

  Savepoints: NO

*************************** 8. row ***************************

      Engine: PERFORMANCE_SCHEMA

     Support: YES

     Comment: Performance Schema

Transactions: NO

          XA: NO

  Savepoints: NO

*************************** 9. row ***************************

      Engine: FEDERATED

     Support: NO

     Comment: Federated MySQL storage engine

Transactions: NULL

          XA: NULL

  Savepoints: NULL

9 rows in set (0.00 sec)

mysql>

4.2.1 InnoDB engine

InnoDB是mysql數(shù)據(jù)庫中的存儲引擎,innodb給mysql的表提供了事務(wù),回滾,崩潰修復(fù)能力,多版本并發(fā)控制的事務(wù)安全

(1)     Innodb那個。存儲引擎支持自動增長列auto_increment.

(2)     Innodb存儲引擎支持外鍵(foreign key)

(3)     Innodb存儲引擎,創(chuàng)建的表的表結(jié)構(gòu)在.frm文件中,數(shù)據(jù)和索引存儲在innodb_data_home_dir和innodb_data_file_path定義的表空間

(4)     Innodb存儲引擎的缺點是讀寫效率稍差,占用的數(shù)據(jù)空間相對較大。

4.2.2 MyISAM engine

MyISAM是mysql中常見的存儲引擎

MyISAM存儲引擎的表存儲成三個文件。文件的名字與表名相同,擴展名包括frm,MYD,MYI,

.其中frm為擴展名的文件存儲表的結(jié)構(gòu);MYD(MYData)為擴展名的文件存儲數(shù)據(jù),MYI(MYindex)為擴展名的文件存儲引擎

MyISAM存儲引擎的優(yōu)勢在于占用空間小,處理速度快。缺點是不支持事務(wù)的完整性和并發(fā)性。

 

4.2.3 MEMORY

特殊存儲引擎,表結(jié)構(gòu)在disk上,數(shù)據(jù)在內(nèi)存中。

Memory表的大小受到顯示,表的大小取決于兩個參數(shù)max_rows和max_heap_table_size

4.2.4 engines的選擇.

特性

InnoDB

MyISAM

MEMORY

事務(wù)安全

支持

存儲限制

64TB

空間使用

內(nèi)存使用

插入數(shù)據(jù)的速度

對外鍵的遲滯

支持

以上是“Mysql如何創(chuàng)建數(shù)據(jù)庫”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

文章標(biāo)題:Mysql如何創(chuàng)建數(shù)據(jù)庫
網(wǎng)頁網(wǎng)址:http://jinyejixie.com/article28/jpopcp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、微信小程序、網(wǎng)站改版、定制網(wǎng)站、App設(shè)計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)
松阳县| 会东县| 雷波县| 收藏| 林西县| 南阳市| 屏南县| 商河县| 缙云县| 焉耆| 宣武区| 宝鸡市| 洛隆县| 喜德县| 和龙市| 青河县| 扶余县| 伊吾县| 分宜县| 百色市| 芒康县| 安徽省| 绩溪县| 浦县| 水富县| 和政县| 望奎县| 宿州市| 兴仁县| 沿河| 杭锦旗| 庐江县| 七台河市| 双牌县| 青岛市| 洞口县| 新密市| 新乡市| 阜新| 旺苍县| 杨浦区|