当前位置:网站首页>Common commands of database 1
Common commands of database 1
2022-07-27 18:21:00 【zh_ Tnis】
1.Win+R Of MySQL On and off of .
- Enable :net start mysql
- close :net stop mysql

2.MySQL Log in and log out of .
- mysql -uroot -p -P3306
- password: password
- sign out :exit perhaps quit

3. Server version 、 date 、 User display
- Display server version :SELECT VERSION();
- Show current date :SELECT NOW();
- Show current user :SELECT USER();
4. Often look at the database .
- show databases;

5. Create database .
- create database demo1;

6.if not exits The use and error created display .
- First of all, we have created demo1 This library , When we create again demo1 An error will be reported , At this time, we can use if not exits

7. View the encoding format of the database .
- show create database database_name;

8. Change the encoding format of the database when creating the database .
- create database database_name character set gbk;
9. Modify the created database code .
- alter database database_name character set gbk;

10. Delete the created library .
- drop database database_name;

11. About the classification of database languages .
- DDL( Data definition language ): Objects used to define the database , Such as data sheet 、 View 、 Index, etc.
- DML( Data manipulation language ): Update in database table 、 Add and delete records
- DCL( Data control language ): It refers to the statements used to set user permissions and control transactions
- DQL( Data query language )(***): Query of data table records
12. The operation of the table .
- That's ok : Record
- Column : Field
13. Enter a library .
- use database_name;

14. Often see which tables exist under the Library .
- show tables;

15. Create table .
- create table table_name1(
- age int unsigned,
- username varchar(20),
- salary float(9.2),
- );

16. View table structure .
- 1:show columns from table_name;
- 2:desc table_name;

17. Insert data into a table .
- 1:insert table_name (col_name1,col_name2,col_name3...) values (col_key1,col_key2,col_key3...);
- 2:insert table_name values (col_key1,col_key2,col_key3...);
- 3:insert table_name (col_name1,col_name2) values (col_key1,col_key2);

18. Look up the records in the table .
- select * from table_name;

19. Delete table records .
- Delete the record of the specified field :delete from table_name where col_name=col_key;
- Delete the records of all fields in the table :delete from table_name;

20. Enable the table to output Chinese , Sometimes we will find that after inserting Chinese data , Use select * from table_name Unable to output Chinese .
- set character_set_results=gb2312;

21. Enable the output records in the table to be aligned .
- charset gbk;

边栏推荐
- Golang waits for a group of goroutines to complete with the return value (2)
- Deep learning: installation package records
- Together with Samsung, vivo will promote exynos980 dual-mode 5g mobile phone!
- CFA exam registration instructions
- [MIT 6.S081] Lec 10: Multiprocessors and locking 笔记
- Collection! 0 basic open source data visualization platform flyfish large screen development guide
- 软件安装相关
- 超实用!阿里P9私藏的Kubernetes学习笔记,看完直呼NB
- 2. Change color space and color detection
- 深度学习:GAT
猜你喜欢
![[MIT 6.S081] Lec 10: Multiprocessors and locking 笔记](/img/62/ca6362830321feaf450865132cdea9.png)
[MIT 6.S081] Lec 10: Multiprocessors and locking 笔记

Deep learning: Gan optimization method dcgan case

Resolve merge fields in salesforce

Exciting collection of new features released by salesforce

2. Change color space and color detection

深度学习:GCN(图卷积神经网络)理论学习总结

动态链表2栈的链表存储结构(LinkedStack实现)

技术分享| 快对讲综合调度系统

二叉树概念

文件路径读取
随机推荐
Deep learning: installation package records
2. Change color space and color detection
Press Google and NVIDIA! Alibaba optical 800 chip won the world's first authoritative test again
IDEA打包war包与war包位置
[learning notes] Lombok's @builder annotation
邮件安全运营难?Coremail携手云商店打造企业邮箱办公新生态!
Marvell公布旗下Arm服务器芯片路线图,下一代性能将比ThunderX2高两倍
Deep learning: gat
Class not found: “com.parkManagement.dao.DaoTest 测试找不到测试类
js工具-cookie简单封装
深度学习:行为识别综述
施耐德电气、欧莱雅等企业巨头如何开放式创新?DEMO WORLD世界创新峰会揭秘
Salesforce runs all test classes and gets coverage reports
登录页面tableLayout(表格布局)
Add music to the program interface and load background photos.
动态链表4单向循环链表(LoopSingle实现)
org.gradle.api.UncheckedIOException: Could not load properties for module ‘gradle-kotlin-dsl‘ from C
深度学习:GAN优化方法-DCGAN案例
贴牌“美国制造”,国产安防设备竟被装上了美航母!
Jrs-303 usage