View MySQL database commands

Source: Internet
Author: User
Tags mysql command line

Viewing MySQL databases is one of our most common operations. The following describes frequently used commands for viewing MySQL Databases in detail. If you are interested in viewing MySQL databases, take a look.

Go to MySQL Command line client
View the currently used database:
Mysql> select database ();
Mysql> status;
Mysql> show tables;

Mysql> show databases; // you can check which databases exist and return the Database Name (databaseName)

Mysql> use databaseName; // Replace the currently used database

Mysql> show tables; // returns the names of all tables in the current database.
Alternatively, you can directly use the following command
Mysql> show tables from databaseName; // databaseName can be obtained using show databases.

Run the following command to view the table structure in mysql:
Desc table name;
Show columns from table name;
Or
Describe table name;
Show create table name;
Or
Use information_schema
Select * from columns where table_name = 'table name ';

View warning:
Rows matched: 1 Changed: 0 Warnings: 1
Mysql> show warnings;
+ --------- + ------ + --------------------------------------------- +
| Level | Code | Message |
+ --------- + ------ + --------------------------------------------- +
| Warning | 1265 | Data truncated for column 'name' at row 3 |
+ --------- + ------ + --------------------------------------------- +
1 row in set
 

How to display MYSQL table information

Three Common MySQL table creation statements

MySQL connection Query

How to Implement MySQL multi-Table insertion

Two tips for MySQL table repair

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.