MySQL getting started

Source: Internet
Author: User

To start the mysqld server, you should start an msdos window and type:

C:/MySQL/bin/mysqld
This will start mysqld in a blank background.

In this way, you can kill the MySQL server and execute:

C:/MySQL/bin/mysqladmin-u root Shutdown

Open command line
C:/MySQL/bin/MySQL

Attached basic commands:

Show all databases
Show databases;

Open Database
Use test

View All Tables
Show tables;

View table structure
Describe PET;

Create a table
Create temporary table TMP (
Article int (4) unsigned zerofill default '100' not null,
Price double (16,2) default '0. 00' not null );

Lock
Lock tables article read;

Add
Insert into TMP select article, max (price) from shop group by article;

Delete
Delete * from TMP where id = '1 ';

Change
Update TMP set price = '000000' where id = '1 ';

Query
Select article, dealer, price from shop, TMP
Where shop. Article = TMP. Articel and shop. Price = TMP. price;

Unlock
Unlock tables;

Delete table
Drop table TMP;

 

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.