MySQL knowledge points and commonly used MYSQL commands for the second-level computer exam

MySQL knowledge points and commonly used MYSQL commands for the second-level computer exam

The basics of MySQL knowledge points for the second-level computer exam, common MYSQL commands, as follows

Commonly used MYSQL commands (add computer secondary sites to favorites)

Start: net start mySql;

Enter: mysql -u root -p/mysql -h localhost -u root -p databaseName;

List databases: show databases;

Select database: use databaseName;

List tables: show tables;

Create a data table: mysql> CREATE TABLE mytable (name VARCHAR(20), sex CHAR(1),

-> birth DATE, birthaddr VARCHAR(20));

Display the properties of table columns: show columns from tableName;

Modify the table structure: DESCRIBE mytable;

Create a database: source fileName.txt;

Matching characters: You can use the wildcard character _ to represent any character, and % to represent any string;

Add a field: alter table tabelName add column fieldName dateType;

Add multiple fields: alter table tabelName add column fieldName1 dateType,add columns fieldName2 dateType;

Multi-line command input: Note that words cannot be broken; when inserting or changing data, the string of the field cannot be expanded to multiple lines, otherwise the hard return will be stored in the data;

Add an administrator account: grant all on *.* to user@localhost identified by "password";

After entering each statement, add a semicolon ';' at the end, or add '\g';

Query time: select now();

Query the current user: select user();

Query the database version: select version();

Query the currently used database: select database( );

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

Finally, I wish you all success in passing the computer level test.

You may also be interested in:
  • Analysis of some knowledge points about the difference between mysqli and mysql in php
  • Summary of Mysql basic knowledge points
  • Summary of MySQL Architecture Knowledge Points
  • Mysql join query principle knowledge points
  • Summary of MySQL ALTER command knowledge points
  • Summary of basic knowledge and operations of MySQL database
  • Summary of B-tree index knowledge points in MySQL optimization
  • MySql knowledge points: transaction, index, lock principle and usage analysis
  • Summary of common knowledge points required for MySQL

<<:  Security configuration and detection of SSL after the website enables https

>>:  A record of pitfalls in JS regular matching

Recommend

Vue implements irregular screenshots

Table of contents Image capture through svg CSS p...

Implementation of pushing Docker images to Docker Hub

After the image is built successfully, it can be ...

Steps to build MHA architecture deployment in MySQL

Table of contents MAH 1. Introduction to MAH Arch...

Solution to the problem that the mysql8.0.11 client cannot log in

This article shares with you the solution to the ...

Ubuntu16.04 builds php5.6 web server environment

Ubuntu 16.04 installs the PHP7.0 environment by d...

Web page text design should be like smart girls wearing clothes

<br />"There are no ugly women in the w...

The background color or image inside the div container grows as it grows

Copy code The code is as follows: height:auto !im...

How to use the concat function in mysql

As shown below: //Query the year and month of the...

Summary of the advantages of Vue3 vs. Vue2

Table of contents 1. Why do we need vue3? 2. Adva...

How to use JS to check if an element is within the viewport

Preface Share two methods to monitor whether an e...

Nginx stream configuration proxy (Nginx TCP/UDP load balancing)

Prelude We all know that nginx is an excellent re...

One line of code teaches you how to hide Linux processes

Friends always ask me how to hide Linux processes...

Related commands to completely uninstall nginx under ubuntu16.04

nginx Overview nginx is a free, open source, high...