当前位置:网站首页>First knowledge database
First knowledge database
2022-07-24 18:58:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
data Library preliminary understanding
What is data (Data)
The so-called data can be symbols 、 written words 、 Numbers 、 voice 、 Images 、 Video and other specific information It is used to describe things What is a database (DataBase abbreviation DB)
Database is a space or warehouse for storing data, but this warehouse is on the computer storage device , And the data is stored in a certain format
The data in the database is organized according to a certain data model 、 Describe and store , With less redundancy 、 High data independence and scalability , And can be used for all kinds of User sharing
The database can also be regarded as the file in the folder, which is the table in the database Database classification :
1. Relational database 2. Non relational database
Relational database : Tables are related to each other You can create tables ( I.e. documents )
Relational databases have :mysql oracale db2 mariadb etc.
Non-relational databases do : mongodb,redis,memcache
The features and advantages and disadvantages of relational database and non relational database
Database type | characteristic | advantage | shortcoming |
|---|---|---|---|
Relational database SQLite、Oracle、mysql | 1、 Relational database , A database that uses a relational model to organize data ;2、 The biggest characteristic of relational database is the consistency of transaction ;3、 Simply speaking , A relational model is a two-dimensional table model , A relational database is a data organization composed of two-dimensional tables and their relationships . | 1、 Easy to understand : Two dimensional table structure is a concept very close to the logical world , Relational models are relatively mesh 、 Layers and other models are easier to understand ;2、 Easy to use : General purpose SQL Language makes it very convenient to operate relational database ;3、 Easy to maintain : Rich integrity ( Entity integrity 、 Referential integrity and user-defined integrity ) It greatly reduces the probability of data redundancy and data inconsistency ;4、 Support SQL, Can be used for complex queries . | 1、 In order to maintain consistency, the huge cost is its poor read-write performance ;2、 Fixed watch structure ;3、 High concurrent read and write requirements ;4、 Efficient reading and writing of massive data ; |
Non relational database MongoDb、redis、HBase | 1、 Using key value pairs to store data ;2、 Distributed ;3、 In general, it does not support ACID characteristic ;4、 A non relational database is not strictly a database , It should be a collection of data structured storage methods . | 1、 No need to go through sql Layer resolution , High read and write performance ;2、 Based on key value pair , The data is not coupled , Easy to expand ;3、 The format of data storage :nosql The storage format is key,value form 、 Document form 、 Picture form and so on , Document form 、 Picture form and so on , Relational databases only support basic types . | 1、 Does not provide sql Support , The cost of learning and using is high ;2、 No transactions , Additional features bi And reports and other support is not good ; |
notes 1: Database transactions must have ACID characteristic ,ACID yes Atomic Atomicity ,Consistency Uniformity ,Isolation Isolation, ,Durability persistence .
notes 2: Persistent storage of data , Especially the persistent storage of massive data , Still need a relational database .
What is database management system (DataBase Management System abbreviation DBMS):
The so-called database management system is the computer software for managing data Mainstream database management system :
MySQL、Oracle、SQLite、Access、MS SQL Server etc.
All the above database management systems are a software , Both have two main functions :
1. Save data to a file or memory
2. Receive specific commands , The file is then manipulated accordingly
Specific application scenarios and application fields of database management system
mysql It is mainly used for large portals , For example, Sogou 、 Sina, etc , Its main advantage is open source , Because the open source database is free , He is now a product of Oracle .
oracle Mainly used in banks 、 The railway 、 Airport, etc . The database is powerful , High software cost . It's also Oracle's product .
sql server It's a Microsoft product , It is mainly used in large and medium-sized enterprises , Like Lenovo 、 Founder et al .Tables and records
What is a watch
The so-called table has actually been mentioned above Is a specific file in the folder
What is a record
The so-called record refers to... In the file Information from multiple fields makes up a record , A line in a file
database server Database management system database The relationship between tables and records ( a key )
database server --- function ---> Database management software
Database management software ---> management ---> database
database --- organization ---> surface , It's a folder --- organization ---> file
surface --- Deposit ---> Multiple records , I.e. documents --- Deposit ---> Multi line content mysql Related introduction
What is? mysql
MySQL Is a relational database management system , The Swedish MySQL AB Companies to develop , At present belongs to the Oracle A subsidiary company .MySQL The most popular relational database management system , stay WEB Application aspect MySQL It's the best RDBMS
(Relational Database Management System, Relational database management system ) One of the application software .mysql It's just one. socekt Server side Client software mysql Bring their own python modular
Download and install
windows Version download
1 download
MySQL Community Server 5.7.16
http://dev.mysql.com/downloads/mysql/2、 decompression
If you want to MySQL Install in the specified directory , Then move the unzipped folder to the specified directory , Such as :C:\mysql-5.7.16-winx64
3、 initialization
MySQL After decompression bin There are a lot of executable files in the directory , stay CMD Execute the following command to initialize the data :
Server side :d:\mysql\mysql-5.7.16-winx64\bin(MySQL The installation path )\mysqld --initialize-insecure
# user name root password : empty 4、 start-up MySQL service
stay CMD Execute commands in to start MySQL service
d:\mysql\mysql-5.7.16-winx64\bin\mysqld5、 start-up MySQL Client and connect MySQL service
Due to the 【mysqld –initialize-insecure】 command , It is not given by default root Account setting password
Client connection :
d:\mysql\mysql-5.7.16-winx64\bin\mysql -u root -p
# Prompt for a password , Directly enter Enter enter enter , The figure below shows that the installation is successful :
Only this and nothing more ,MySQL The server has been installed successfully and the client can connect , Operate later MySQL when , Just repeat the above 4、5 Step by step . however , stay 4、5 It is cumbersome to repeatedly enter the executable file directory in step , If you want to be easy to operate in the future , You can do the following .
a. Add environment variables
take MySQL Executable files are added to environment variables , Thus, the execution command can be executed
【 Right click the computer 】--》【 attribute 】--》【 Advanced system setup 】--》【 senior 】--》【 environment variable 】--》【 Find... In the second content box A variable called Path A line , double-click 】<br> --> 【 take MySQL Of bin The directory path is appended to the variable value , use ; Division 】
Such as :
D:\mysql\mysql-5.7.16-winx64\binIn this way , When you start the service and connect later , Only :
# start-up MySQL service , Input... At the terminal
mysqld
# Connect MySQL service , Input... At the terminal :
mysql -u root -pb. take MySQL Service production into windows service
The last step solved some problems , But not completely , Because it's executing 【mysqd】 start-up MySQL Server time , The current terminal will be hang live , Then make a setting to solve this problem :
# Make MySQL Of Windows service , Execute this command at the terminal :
"d:\mysql\mysql-5.7.16-winx64\bin\mysqld" --install
# remove MySQL Of Windows service , Execute this command at the terminal :
"d:\mysql\mysql-5.7.16-winx64\bin\mysqld" --removeAfter registering as a service , Turn it on and off later MySQL The service , Simply execute the following command :
# start-up MySQL service
net start mysql
# close MySQL service
net stop mysqlLinux Version download
1. install :
yum install mysql-server 2. Server startup
mysql.server start3. Client connection
Connect :
mysql -h host -u user -p
Common mistakes :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2), it means that the MySQL server daemon (Unix) or service (Windows) is not running.
sign out :
QUIT perhaps Control+DPublisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/124519.html Link to the original text :https://javaforall.cn
边栏推荐
- Wireshark simple filter rule
- BUUCTF-pwn[1]
- DDR SDRAM board design guide
- MySQL hidden version number
- New stage of investment
- Zip compression and decompression
- Add column by column selection for JTable
- Latex mathematical formula
- Why is gradient the fastest changing direction of function
- Colon sorting code implementation
猜你喜欢
![BUUCTF-pwn[1]](/img/93/6b9fe53b31e0c846b8c2ec7ab793ce.png)
BUUCTF-pwn[1]

matplotlib

Common problems of multithreading and concurrent programming (to be continued)

2022 Hangdian multi school second session 1009 shuangq (Mathematics)

FPGA 20 routines: 9. DDR3 memory particle initialization write and read through RS232 (Part 1)

Understand dynamic calculation diagram, requires_ grad、zero_ grad

L4l7 load balancing

Reading notes of XXL job source code

轻松学Pytorch-迁移学习实现表面缺陷检查

Pam4 popular science
随机推荐
Go小白实现一个简易的go mock server
QT - animation frame
Crazy God redis notes 11
今日睡眠质量记录79分
vim相关介绍
32-bit stack overflow advanced
Nacos简介和控制台服务安装
Mysql database, subquery, union, limit
Latex mathematical formula
The problem that files cannot be uploaded to the server using TFTP is solved
Rookie colleagues cost me 2K. Did you recite the secret of salary increase? (collect it quickly!)
Understand dynamic calculation diagram, requires_ grad、zero_ grad
OpenGL learning (III) glut two-dimensional image rendering
Why is gradient the fastest changing direction of function
redis 数据类型
永恒之蓝MS17-010exp复现
Ionic4 learning notes 7 -- UI component 1 (no practice, direct excerpt)
JDBC batch inserts 100000 /1million pieces of data
LTSpice software power settings
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag