Database Basics Getting Started statement

Source: Internet
Author: User

1. Connect to the server2. View all Libraries3. Create a library4. Deleting a library5. Select a database6. View the table7. Create a simple table8. Delete a table9. Change the table name10. Clear the table1 、--on my Computer on Windows find the MySQL database installation directory and go to the bin directory--Enter DOS window, CD in C packing directory\program Files (x86) \mysql\mysql Server 5.5\bin into the bin directory --connect to MySQL. Mysql-u User name-p password Enter the above indicates that the database is connected. 2, see how many databases: show databases;
3.Creating a database: Create library name;4. Delete a database: Drop library name;5, select the database: Use database name;
6. View a database table: show tables;
7. Create a simple table: the CREATE TABLE table name (ID int,age int,name varchar);8, Delete table: drop table name;9, change the table name: Rename table name to the new table name; 10, clear the table:--truncate table name; --delete from table name;
The difference:truncate is the deletion of the entire table, which is a completely new table, soon, but not safe. Delete is the deletion of row data, or the existence of a table.

Null

Database Basics Getting Started statement

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.