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; // 退出数据库服务器

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