MySQL Database basic operations (03)

Source: Internet
Author: User

  • Mysql-h host Address-u user name-P user password enter MySQL database

  • Mysqladmin-u username-p Old password password new password change password




  • SHOW DATABASES; List databases

  • Use database_name using database_name database

  • Create DATABASE (IF EXISTS) data_name creating databases named Data_name

  • Drop database Data_name Delete a db named Data_name




  • CREATE TABLE tb_name (col1,col2 ...                 ); Create a table (before you must specify a database)

  • 650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7E/E0/wKioL1cLrQbhZl2_AAAKGJ5GW0w801.png "style=" float: none; "title=" 1.png "alt=" Wkiol1clrqbhzl2_aaakgj5gw0w801.png "/>



  • SHOW TABLES from Db_name; To view a table in a library

  • 650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/E3/wKiom1cLrFPziPQQAAAHpW1QxSc110.png "title=" 3.png " alt= "Wkiom1clrfpzipqqaaahpw1qxsc110.png"/>

  • DESC tb_name; View table structure

  • 650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7E/E0/wKioL1cLrQaxjlIaAAARoVZ2lVI021.png "title=" 2.png " alt= "Wkiol1clrqaxjliaaaarovz2lvi021.png"/>

  • drop table tb_name;

Modify Table

ALTER TABLE Tb_name

MODIFY Change ADD DROP

INSERT into Tb_name (Col1,col2 ... ) values| VALUE (' STRING ', NUM)








This article is from "Up for the future ..." Blog, be sure to keep this source http://goodang.blog.51cto.com/10277564/1762787

MySQL Database basic operations (03)

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.