MySQL Quick Start

Source: Internet
Author: User
Tags mysql mysql database
Mysql| QuickStart After using other databases such as: Oracle,sybase, and so on, when using the MySQL database to get started, general care how I know the current database, what tables in the database, table structure? How to execute an external SQL file, and so on, based on SQL data collation of MySQL QuickStart information, I hope to understand other databases and want to go to MySQL's beginners to help.

1: Show the database
Show DATABASES,

2: The currently selected database,

Mysql> SELECT DATABASE ();
+------------+
| DATABASE () |
+------------+
| Test |
+------------+

3: Table information contained in the current database:
Mysql> show TABLES;
+---------------------+
| Tables in Test |
+---------------------+
| Mytable1 |
| Mytable2 |
+---------------------+

4: Get the table structure
mysql> desc Mytable1;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| S1 | varchar (20) |   YES | |    NULL | |
+---------+-------------+------+-----+---------+-------+

5: Execute an external SQL script

shell> MySQL < Input.sql
Executing input.sql on the current database
Or
shell> MySQL Test < Input.sql
Executing input.sql on the test database

"This article copyright belongs to the author and the Osso net jointly owns, if needs to reprint, please indicate the author and the source" &

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.