Contents of MySQL under DOS

Source: Internet
Author: User

First, configure the environment and login settings

1.1 Setting the System environment variables:
X:\wnmp\mysql\bin
Load the Ptah in the environment variable of the system, add at the end of the last variable; x the disk symbol stored for MySQL

2.2 Set Password:
Mysql-uroot-p
Password
Set Password=password (' Password ');

2.3 Enter the database:

2.3.1
Mysql-uroot-proot

This is a one-time input account and clear text password enter-u for the account fill-p to fill in the password


2.3.2

Mysql-uroot-p
Password

This is two times enter account and dark text password Enter-u for account fill-p after enter will appear password: After, fill in password enter

Second, create the database

2.1 Creating a Database
Create database if not exists XXXX;

XXXX is the library name of the database

2.2 Displaying database information
show databases;

Show All the Libraries

Third, view the relevant

3.1 Open File List
Use XXX;

XXX, the name of the library to view

3.2 Viewing the contents of a table
3.2.1

Desc XXXX;

XXXX is the name of the table to view
3.2.2

Show CREATE TABLE XXXX;

XXXX is the name of the table to view

3.3 Querying the inserted statements and values
Select *from XXXX;

XXXX is the name of the table to view

3.4 Add Chinese ID
Set names UTF8;

Four, create a form

4.1, create a table table value not filled by default is null NOT NULL
CREATE table if not EXISTS ' XXXX ' (
ID Int (ten) is not NULL,
.......
) engine=innodb DEFAULT charset= ' UTF8 ';

XXXX is the table name

Fields need to be used; Separates the last field without symbols

4.2, create a table to determine the primary key and self-increment
CREATE table if not EXISTS ' XXXX ' (
ID Int (ten) unsigned not NULL primary key auto_increment
.......
) engine=innodb DEFAULT charset= ' UTF8 ';

XXXX is the table name
Primary key Set Primary key
Auto_increment Setting the self-increment

Fields need to be used; Separates the last field without symbols


4.3, inserting data

4.3.1
Insert INTO ' XXXX ' values (XXX, ' xxx ', ' xxx ');

Table Name Value
4.3.2,
Insert INTO ' XXXX ' (xxxx,xxxx,xxxx) VALUES (xx, ' xx ', ' xx ');

Indicates the field name value

Contents of MySQL under DOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.