MySQL數據庫-筆記01【數據庫概念、數據庫安裝、終端操作數據庫】

學習地址:一天學會 MySQL 數據庫https://www.bilibili.com/video/BV1Vt411z7wy】 

 

MySQL安裝教程:https://blog.csdn.net/weixin_44949135/article/details/106661080

  1. 🚀01-03:【筆記01】https://blog.csdn.net/weixin_44949135/article/details/105505630
  2. 🚀04-15:【筆記02】https://blog.csdn.net/weixin_44949135/article/details/106686808
  3. 🚀16-21:【筆記03】https://blog.csdn.net/weixin_44949135/article/details/106694730
  4. 🚀22-29:【筆記04】https://blog.csdn.net/weixin_44949135/article/details/106728980
  5. 🚀30-54:【筆記05】https://blog.csdn.net/weixin_44949135/article/details/106731538
  6. 🚀55-64:【筆記06】https://blog.csdn.net/weixin_44949135/article/details/106735501


MySQL專欄:https://blog.csdn.net/weixin_44949135/category_10101442.html

目   錄

01-數據庫初體驗

02-數據庫概念與mysql安裝

數據庫 概念

MySQL概念

MySQL官網【https://www.mysql.com/】

下載MySQL安裝包、安裝MySQL(超級詳細的喲~~~)

03-終端操作mysql數據庫

1、登錄數據庫(mysql -u用戶名 -p密碼)

2、查詢數據庫服務器中的所有數據庫(show databases;)

3、操作某一個數據庫(use 數據庫名;)

4、查詢數據庫中的數據表信息(select * from 數據表名;)

5、查詢數據表中的某一條數據(select * from 數據表名 where 表字段 = "值";)

6、退出數據庫(exit;)


01-數據庫初體驗

02-數據庫概念與mysql安裝

數據庫 概念

百度百科:https://baike.baidu.com/item/%E6%95%B0%E6%8D%AE%E5%BA%93/103728?fr=aladdin

數據庫是“按照數據結構來組織、存儲和管理數據的倉庫”。是一個長期存儲在計算機內的、有組織的、可共享的、統一管理的大量數據的集合。

數據庫是以一定方式儲存在一起、能與多個用戶共享、具有儘可能小的冗餘度、與應用程序彼此獨立的數據集合,可視爲電子化的文件櫃——存儲電子文件的處所,用戶可以對文件中的數據進行新增、查詢、更新、刪除等操作。

 

關係數據庫

關係型數據庫,存儲的格式可以直觀地反映實體間的關係。關係型數據庫和常見的表格比較相似,關係型數據庫中表與表之間是有很多複雜的關聯關係的。 常見的關係型數據庫有MysqlSqlServer等。在輕量或者小型的應用中,使用不同的關係型數據庫對系統的性能影響不大,但是在構建大型應用時,則需要根據應用的業務需求和性能需求,選擇合適的關係型數據庫。

MySQL概念

MySQL是一種開放源代碼的關係型數據庫管理系統(RDBMS),使用最常用的數據庫管理語言--結構化查詢語言(SQL)進行數據庫管理。

MySQL是開放源代碼的,因此任何人都可以在General Public License的許可下下載並根據個性化的需要對其進行修改。

MySQL因爲其速度、可靠性和適應性而備受關注。大多數人都認爲在不需要事務化處理的情況下,MySQL是管理內容最好的選擇。

MySQL官網https://www.mysql.com/

下載MySQL安裝包、安裝MySQL(超級詳細的喲~~~)

我的另一篇博客!!!內容比較多,分離出來了!!!

https://blog.csdn.net/weixin_44949135/article/details/106661080

03-終端操作mysql數據庫

1、登錄數據庫mysql -u用戶名 -p密碼

mysql -uroot -plwx // 登錄MySQL數據庫


Microsoft Windows [版本 10.0.17763.1217]
(c) 2018 Microsoft Corporation。保留所有權利。

C:\Users\lwx>mysql -uroot -plwx
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.56 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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.

2、查詢數據庫服務器中的所有數據庫show databases;

show databases; // 查詢數據庫服務器中所有的數據庫

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| book               |
| card               |
| college            |
| hibernate_day01    |
| hibernate_day02    |
| hibernate_day03    |
| hibernate_day04    |
| library            |
| mysql              |
| performance_schema |
| rzw                |
| student            |
| students           |
| test               |
| test01             |
| testdata           |
+--------------------+
17 rows in set (0.00 sec)

  

3、操作某一個數據庫use 數據庫名;

use 數據庫名;

mysql> select * from login;
+--------+----------+
| name   | password |
+--------+----------+
| 123    | 123      |
| 1234   | 1234     |
| 12345  | 12345    |
| lwx    | 123456   |
| lwx123 | 123456   |
+--------+----------+
5 rows in set (0.00 sec)

mysql> 

4、查詢數據庫中的數據表信息select * from 數據表名;

5、查詢數據表中的某一條數據select * from 數據表名 where 表字段 = "值";)

mysql> select * from login where name = "123";
+------+----------+
| name | password |
+------+----------+
| 123  | 123      |
+------+----------+
1 row in set (0.00 sec)

mysql>

  

6、退出數據庫服務器exit;

exit; // 退出數據庫服務器

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章