当前位置:网站首页>MySQL overview
MySQL overview
2022-07-05 15:36:00 【GALi_ two hundred and thirty-three】
brief introduction
MySQL It's a Relational database management system , The Swedish MySQL AB Companies to develop , Belong to Oracle Its products .MySQL Is one of the most popular relational database management systems , stay WEB Application aspect ,MySQL It's the best RDBMS (Relational Database Management System, Relational database management system ) One of the application software .
DB : database (database): Storing data “ Warehouse ”. It holds a series of organized data .
DBMS: Database management system (Database Management System). Database is through DBMS gen Build and operate containers .
SQL: Structured query language (Structure Query Language): A language designed to communicate with a database said .
SQL Language classification
- DML(Data Manipulation Language): Data manipulation statement , For adding Add 、 Delete 、 modify 、 Query database records , And check data integrity
- INSERT: Add data to the database
- UPDATE: Modify the data in the database
- DELETE: Delete data from database
- SELECT: choice ( Inquire about ) data
- DDL(Data Definition Language): Data definition statement , For libraries and The creation of a table 、 modify 、 Delete .
- 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
- DCL(Data Control Language): Data control statement , Used to define Access rights and security levels of users
- GRANT: Grant access to
- REVOKE: Revoke access
- COMMIT: Commit transaction
- ROLLBACK: Transaction fallback
- SAVEPOINT: Set the savepoint
- LOCK: Lock specific parts of the database
Service startup and shutdown
Open as Administrator cmd window
net start mysql
net stop mysql

Login and exit
Mode one :
use mysql The command line client comes with ( only root user )

Mode two :
mysql -h [ Host name /IP] -P [port] -u [user] -p
mysql -h localhost -P 3306 -u root -p
Local users : mysql -uroot -proot
Port number default 3306

Common command
MySQL [(none)]> show databases; # view the database
MySQL [(none)]> use test; # Use / Open database (test)
MySQL [test]> select database(); # View the current database
MySQL [mysql]> show tables; # View the tables in the current database
MySQL [test]> create table stuinfo( # Create table
-> id int, # Name type
-> name varchar(20));

MySQL [test]> desc stuinfo; # View table structure

MySQL [test]> insert into stuinfo (id, name) values(1, 'Tom'); # insert data
MySQL [test]> select * from stuinfo; # Look at the data in the table

MySQL [test]> update stuinfo set name="John" where id=1; # Modifying data

MySQL [test]> delete from stuinfo where id=1; # Delete data

MySQL [test]> select version(); # see mysql edition
MySQL [test]> exit # sign out
System command
C:\WINDOWS\system32>mysql --version
mysql Ver 15.1 Distrib 10.1.38-MariaDB, for Win64 (AMD64)
C:\WINDOWS\system32>mysql -V
mysql Ver 15.1 Distrib 10.1.38-MariaDB, for Win64 (AMD64)
Grammatical norms
- Case insensitive , But it is recommended that keywords be capitalized , Table name 、 Column names in lowercase
- It's better to end each command with a semicolon
- Every command is as needed , You can indent Or a new line
- notes
- Single-line comments :# Note text
- Single-line comments :-- Note text
- Multiline comment :/* Note text */
边栏推荐
- 超越PaLM!北大碩士提出DiVeRSe,全面刷新NLP推理排行榜
- MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
- sql server char nchar varchar和nvarchar的区别
- 一文搞定vscode编写go程序
- Common PHP interview questions (1) (written PHP interview questions)
- Common MySQL interview questions (1) (written MySQL interview questions)
- ICML 2022 | explore the best architecture and training method of language model
- Nine hours, nine people, nine doors problem solving Report
- Redis distributed lock principle and its implementation with PHP (2)
- Write a go program with vscode in one article
猜你喜欢
![P1451 calculate the number of cells / 1329: [example 8.2] cells](/img/c4/c62f3464608dbd6cf776c2cd7f07f3.png)
P1451 calculate the number of cells / 1329: [example 8.2] cells

爱可可AI前沿推介(7.5)

Value series solution report

Advanced level of static and extern

Live broadcast preview | how to implement Devops with automatic tools (welfare at the end of the article)

lv_font_conv离线转换

Ctfshow web entry command execution

wxml2canvas

华为哈勃化身硬科技IPO收割机

D-snow halo solution
随机推荐
lvgl 显示图片示例
No one consults when doing research and does not communicate with students. UNC assistant professor has a two-year history of teaching struggle
美团优选管理层变动:老将刘薇调岗,前阿里高管加盟
Stop B makes short videos, learns Tiktok to die, learns YouTube to live?
Explanation report of the explosion
【 note 】 résoudre l'erreur de code IDE golang
Appium自动化测试基础 — APPium基础操作API(一)
F. Weights assignment for tree edges problem solving Report
P1451 calculate the number of cells / 1329: [example 8.2] cells
Calculate weight and comprehensive score by R entropy weight method
超越PaLM!北大硕士提出DiVeRSe,全面刷新NLP推理排行榜
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability
把 ”中台“ 的思想迁移到代码中去
Bugku's steganography
六种常用事务解决方案,你方唱罢,我登场(没有最好只有更好)
CSRF, XSS science popularization and defense
Redis distributed lock principle and its implementation with PHP (2)
Appium automation test foundation - appium basic operation API (II)
DVWA range clearance tutorial
sql server学习笔记