Basic MySQL operations (console)

Source: Internet
Author: User
The following articles mainly introduce the basic operation steps of MySQL basic operations (console). If you are interested in the actual operations of MySQL basic operations (console, you can use this article to have a better understanding of its related content. The following is a detailed description of the article. 1. log on to the mysql server: mysql-hlocalhost (or 127.0.0.1)

The following articles mainly introduce the basic operation steps of MySQL basic operations (console). If you are interested in the actual operations of MySQL basic operations (console, you can use this article to have a better understanding of its related content. The following is a detailed description of the article. 1. Enter the mysql server: mysql-h localhost (or 127.0.0.1)

The following articles mainly introduce the basic operation steps of MySQL basic operations (console). If you are interested in the actual operations of MySQL basic operations (console, you can use this article to have a better understanding of its related content. The following is a detailed description of the article.

1. log on to the mysql server:

> Mysql-h localhost (or 127.0.0.1)-u root (enter the user name)-p (Press enter and enter the password ).

2. Use the show statement to view the databases on the current server.

 
 
  1. mysql>show databases;

3. Basic MySQL operations (console): use an existing database:

 
 
  1. mysql>use database_name;

4. Create a database:

 
 
  1. mysql>create database database_name;

5. display tables in a database:

 
 
  1. mysql>show tables;

6. Create a table:

 
 
  1. mysql>create table table_name(c1 varchar(20),c2 int(3),......);

7. display fields in the table book:

 
 
  1. mysql>describe book;

8. MySQL basic operation (console): add multiple records to the table at a time:

 
 
  1. mysql>insert into book values (value_1,value_2.....),.....(value_n,value_n+1);

For more detailed operations, see the MySQL reference manual.

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.