MySQL Operation highlights

Source: Internet
Author: User

After MySQL installation is successful, you can see that there are already several databases of MySQL, INFORMATION_SCHEMA and test, the INFORMATION_SCHEMA library has a table named columns, which records field information for all tables in the database. Once you know the table, you need only one SELECT statement to get the fields for any table.

For example: SELECT column_name from INFORMATION_SCHEMA. COLUMNS WHERE table_name = ' your_table_name '; this is a bit of a problem, if there are multiple databases where you want to query the name of the table, then the results of the query will include all the field information.

Through the DESC information_schema. Columns can see that the column named Table_schema in the table is the record database name, so the following is more rigorous: SELECT column_name from INFORMATION_SCHEMA. COLUMNS WHERE table_name = ' your_table_name ' and table_schema = ' your_db_name ';

MySQL Operation highlights

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.