当前位置:网站首页>MySQL of database -- overview and installation
MySQL of database -- overview and installation
2022-04-23 09:20:00 【King_ nul】
Catalog
Chapter one : Database Overview
1.3 SQL The classification of languages
Chapter one : Database Overview
1.0 What is a database
From wikipedia : database , Also known as data management system (DBMS), In short, it can be regarded as electronic Of File cabinet —— Storage Electronics file Premises , The user can be right file Data running in newly added 、 Intercept 、 to update 、 Delete Wait for the operation . So-called “ database ” Tied to Certain way Stored together 、 Can be given to multiple users share 、 As small as possible Redundancy 、 Data independent of the application aggregate . A database consists of multiple surface Space (Tablespace) constitute .
In a nutshell , A database is a warehouse for storing data , It's like you (DBA) To a warehouse ( database ), Unlock first , Open door (DBMS), Go into the warehouse and get ( Operational data ) What you need ( data ); As shown in the figure below ( I drew it myself , If there are deficiencies , The comments indicate that ) Common database management system (DBMS) Yes :Mysql,SQLserver,Oracle,DB2 etc. ;( I'm here only for Mysql Make an introduction , But most database management systems have something in common )
1.1 Database introduction
DB: database (database): A for storing data ‘ Warehouse ’, Save a series of organized data .
DBMS( Database management system ): Database administrator (DBA) It's through DBMS To create and manage databases (DB) Of .
SQL: Structured query language , It's a language for communicating with databases ( By manipulating the sql Language to realize some functions )
1.2 MySQL The advantages of
① Open source
MySQL It's an open source database management system , Given the user can modify , Optimization and other permissions , This is also MySQL The power of , And very popular reasons .
② MySQL The cost is low
MySQL There are community version and enterprise version , The Community Edition is completely free , And the enterprise edition is charged , But relative to Oracle、DB2 The charges are still relatively advantageous .
③ Cross platform
To put it simply MySQL Can run on different operating systems , such as MySQL It can be used in office windows Up operation , It can also be used in the operating system commonly used by the server Unix Up operation .
④ Lightweight
MySQL The core program is fully multithreaded , These threads are lightweight processes , It is flexible to provide services for users at the same time , It doesn't take up too many resources . therefore MySQL Can be faster 、 Efficient data processing .
1.3 SQL The classification of languages
1、DML(Data Manipulation Language): Data manipulation statement , For adding Add 、 Delete 、 modify 、 Query database records , And check data integrity
DML Used to query and modify data records , Includes the following SQL sentence :
#"#" Indicates a single line comment ,/**/ For multiline comments
#INSERT: Add data to the database
#UPDATE: Modify the data in the database
#DELETE: Delete data from database
#SELECT: choice ( Inquire about ) data
2、DDL(Data Definition Language): Data definition statement , For libraries and The creation of a table 、 modify 、 Delete .
DDL Used to define the structure of the database , Such as creating 、 Modify or delete Database objects , Includes the following SQL sentence :
/*
CREATE TABLE: Create database tables
ALTER TABLE: Change table structure 、 add to 、 Delete 、 Modify column length
DROP TABLE: Delete table
CREATE INDEX: Index on a table
DROP INDEX: Delete index
*/
3、DCL(Data Control Language): Data control statement , Used to define Access rights and security levels of users .
DCL Used to control database access , Includes the following SQL sentence :
/*
GRANT: Grant access to
REVOKE: Revoke access
COMMIT: Commit transaction
ROLLBACK: Transaction fallback
SAVEPOINT: Set the savepoint
LOCK: Lock specific parts of the database
*/
1.4MySQL8.0.22 install
- Download it first MySQL Installation package ( The website links :https://dev.mysql.com/downloads/mysql/)【 Cloud disk :https://pan.baidu.com/s/16TEiyq7oWe29Rpow_WzzMA Extraction code : j6b1 】
- The official download ( Website is 8.0.23 edition , The first installation free version is also a command-line version without visual graphics )
3. After downloading, unzip it to the path specified by yourself ( My path is F:\mysql\mysql-8.0.22-winx64\mysql-8.0.22-winx64\bin)
4. Configure environment variables
My computer –> attribute –> senior –> environment variable —>Path —> edit Add... To the system variable mysql Install under directory bin Folder address
5. The configuration file
establish mysql The configuration file , stay mysql Installation directory , newly build my.ini file , edit my.ini file , Pay attention to changing the path to your own file path .
## The contents of the configuration file are as follows
[mysql]
# Set up mysql Client default character set
default-character-set=utf8
[mysqld]
# Set up 3306 port
port = 3306
# Set up mysql Installation directory ( Pay attention to changing to your own path )
basedir=F:\mysql\mysql-8.0.22-winx64\mysql-8.0.22-winx64
# Set up mysql Database data storage directory ( Pay attention to changing to your own path )
datadir=F:\mysql\mysql-8.0.22-winx64\mysql-8.0.22-winx64\data
# Maximum connections allowed
max_connections=200
# The character set used by the server defaults to 8 Bit coded latin1 Character set
character-set-server=utf8
# Number of connection failures allowed .
max_connect_errors=10
# The default storage engine that will be used when creating a new table
default-storage-engine=INNODB
6. install MySQL service
Open the command line as Administrator , Get into MySQL Installation directory bin Under the table of contents
# Enter the installation position bin Under the table of contents
PS C:\Windows\system32> cd F:\mysql\mysql-8.0.22-winx64\mysql-8.0.22-winx64\bin
PS F:\mysql\mysql-8.0.22-winx64\mysql-8.0.22-winx64\bin>
# Run the installation code win10 Super administrators may need to add ./ perhaps .\
mysqld --install
# perhaps .\mysqld --install
My is a blue background , Because I've already installed it, I brought the online map ( The appearance of successful installation is shown in the black background )
next , initialization MySQL service , When finished, it will generate data File if not , Just create a , Then do it again
mysqld --initialize-insecure --user=mysql
7. Sign in
Once the initialization is complete , Start... First MySQL service , Then use the command to log in to MySQL
# start-up MySQL service ( You cannot log in until the service is started )
net start MySQL
# stop it MySQL service
net stop MySQL
# Sign in MySQL, Install on your own computer ip Use localhost, The port number can be omitted ( It's usually 3306)
mysql -h host IP Address -P Port number -u user name -p # enter
Enter Password: password # You can enter directly without entering the password
# Reset password
alter user 'root'@'localhost' identified by ' Enter your own password ';
Query OK, 0 rows affected (0.01 sec) # It means that the modification was successful
# Example
mysql -h localhost -uroot -p
# Other clients , for example : Visualization tools Navicat etc.
Today's MySQL Overview installation , It's over here , I hope I can help the little friends who love learning , If there are shortcomings, please point out in the comments or private chat .
版权声明
本文为[King_ nul]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230629527887.html
边栏推荐
- Flink同时读取mysql与pgsql程序会卡住且没有日志
- MySQL小练习(仅适合初学者,非初学者勿进)
- The most concerned occupations after 00: civil servants ranked second. What was the first?
- GoLand debug go use - white record
- Colorui solves the problem of blocking content in bottom navigation
- SAP 101K 411K 库存变化
- Wechat applet catchtap = "todetail" event problem
- tsdf +mvs
- 501. Mode in binary search tree
- Operation not allowed for a result set of type resultset TYPE_ FORWARD_ ONLY. Explain in detail
猜你喜欢
Go language learning notes - structure | go language from scratch
The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution
Redis Desktop Manager for Mac
108. Convert an ordered array into a binary search tree
【SQL server速成之路】数据库的视图和游标
Brush classic topics
Open services in the bottom bar of idea
Resource packaging dependency tree
《數字電子技術基礎》3.1 門電路概述、3.2 半導體二極管門電路
Project upload part
随机推荐
kettle庖丁解牛第14篇之JSON输入
Failed to prepare device for development
DJ music management software pioneer DJ rekordbox
On array replication
Go language self-study series | golang method
Mini - exercice MySQL (seulement pour les débutants, pas pour les non - débutants)
Get trustedinstaller permission
SQL used query statements
Chapter VIII project stakeholder management of information system project manager summary
Valgrind and kcache grind use run analysis
Write down the post order traversal of the ~ binary tree
搞不懂时间、时间戳、时区,快来看这篇
Applet in wechat and app get current ()
653. Sum of two IV - input BST
LeetCode396. Rotate array
108. Convert an ordered array into a binary search tree
web页面如何渲染
Leetcode-199 - right view of binary tree
Bk3633 specification
【SQL server速成之路】数据库的视图和游标