MYSQL _ common database commands

Source: Internet
Author: User


MYSQL _ common database commands 1. log on to www.2cto.com $ mysql -- user = root -- password = xxxxxx 2. database Operations list all databases mysql> show databases; create database mysql> create database x123; delete database mysql> drop database x123; connect to and use database mysql> use x123; 3. data table operation display data table mysql> show tables; create data table mysql> create table mytable (name VARCHAR (20), sex CHAR (1), birth DATE); display mysql> describe mytable; insert data into the table mysql> insert into mytable values ('xieyan ', 'F', '2017-01-01 '); for specific conditions, find mysql> select * from mytable where sex = "f"; for Fuzzy conditions, find mysql> select * from mytable where name like "% xie % "; delete the data table mysql> drop table mytable; read and insert data from the TXT file. SAE does not support the load data command (TXT file format: Use spaces to separate fields, and use line breaks to separate records) mysql> load data local infile "testme.txt" into table mytable;

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.