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

A brief introduction to JavaScript arrays

Table of contents Introduction to Arrays Array li...

js and jquery to achieve tab status bar switching effect

Today we will make a simple case, using js and jq...

Implementation of Nginx filtering access logs of static resource files

Messy log Nginx in daily use is mostly used as bo...

How to install Linux flash

How to install flash in Linux 1. Visit the flash ...

Detailed explanation of the use of stat function and stat command in Linux

stat function and stat command Explanation of [in...

How to use JavaScript to determine several common browsers through userAgent

Preface Usually when making h5 pages, you need to...

Analysis of centos6 method of deploying kafka project using docker

This article describes how to use docker to deplo...

Detailed tutorial on uploading and configuring jdk and tomcat on linux

Preparation 1. Start the virtual machine 2. git t...

Native js to implement a simple calculator

This article example shares the specific code of ...

Solution to the problem of z-index not taking effect in CSS3

I recently wrote a combination of CSS3 and js, an...

How to build DockerHub yourself

The Docker Hub we used earlier is provided by Doc...

MySQL 5.7.17 installation and configuration method graphic tutorial (windows)

1. Download the software 1. Go to the MySQL offic...

Navicat cannot create function solution sharing

The first time I wrote a MySQL FUNCTION, I kept g...