SQL file for importing data tables from MySQL

Source: Internet
Author: User
1. display the Database List. Show databases; At the beginning, there were only two databases: MySQL and test. The MySQL database contains the MySQL system information. We change the password and add new users to use this database for operations. 2. display the data tables in the database: Use anying; // when you open the database, show tables is no stranger to FOXBASE. 3. display the data table structure: Describe table name; 4. database creation: Create Database database name; 5. Table creation: Use Database Name; Create Table Name (field setting list); 6. Database deletion and table deletion: drop database database name; drop table name; 7. Clear the records in the Table: delete from table name; 8. display the records in the Table: Select * from table name; 9. display the Database Name of use: select database (); 10. display the current user: Select User ();

Prerequisites

Computer properties-environment variables-New-variable value input MySQL path

C: \ Program Files \ mysql \ MySQL Server 5.0 \ bin \

Step 1 first open the MySQL database creation command

Database creation:
Create Database database name;
Displays the Database List.
Show databases; Use this command to determine whether the database is successfully created. If the database is successfully created! Then proceed to the next step
Step 2
Open the command line in the Start menu and Enter cmd.
First, use the CD switch path command to switch to the SQL directory.
Cd c: \ Program Files \ mysql \ MySQL Server 5.0 \ bin \
After switching, enter the SQL File Import command
Mysql-u root-pabc123456 anying <E: \ data \ heroes. SQL
After entering the information, you can enable MySQL
2. display the data tables in the database:
Use anying; // open the database. If you have learned FOXBASE, you will not be familiar with it.
Show tables;
Determine whether the table has been imported successfully!

 
 
 

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.