mysql database basics notes

  • 2020-05-13 03:41:11
  • OfStack

Go to install directory... / bin mysql exe

cd replacement directory dir lists all files in the current directory

c:\vesa\...\a > Angle brackets indicate the... in c disk/vasa/... / in the a folder

cd space.. Represents a directory one level up

cd blank directory name to enter the specified directory

The cd space ted indicates that you view the directory name in order

> mysql space -u username -p password (that is, access to the database through the username and password)

show databases; Display all databases

use database name; Means access to the database

show tables; Displays all data tables

select * from data table name; View the data in the table

Insert: insert into field name (omitted not written to indicate all fields) values value; (field name 1- > Value 1 field name 2- > Value of 2... Order 1 sample number 1 sample)

Update: update table name set field name = value; (where field name = value and field name = value)

Query: select field list from table name; (where field name = value and field name = value)

Delete: delete from table name; (where field name = value and field name = value)

Create database: create database database name;

Delete list: drop table table name... ;

Delete database: drop database database name;

View table properties: describe table name;

Modify table properties: alter table table name modify column field name type;

Modify table name: rename table table name after the original to table name;

Create data table: create table data table name (item name type.., item name type..,...) ;

Related articles: