MySQL table creation and data batch import guide.

Source: Internet
Author: User
Tags mysql commands

1. How to connect to MySQL

Use the command line.

My MySQL is installed in C:/MySQL

Enter: DOS environment.

C:/MySQL/bin> mysql-uroot-p-hlocalhost
Enter Password :******

If the connection is successful, you will see: Welcome to the MySQL monitor.

Common MySQL commands:
Create instance: Create Database test1; (create a folder named test1 under C:/MySQL/data)
View all instances: Show databases;
Use test1;

You can create tables, permission management, and other commands by referring to standard SQL.

2. How to import data tables
2.1 First prepare the DDL for creating the table. My DDL is script_mysql. SQL
2.2 import DDL.
C:/mysql> mysql-uroot-p-hlocalhost -- default-character-set = sjis database instance name <DDL file storage path (absolute path)/script_mysql. SQL

3. How to import data
3.1 first, prepare the data DDL. My DDL is masterdata. SQL.
3.3 import DDL
C:/mysql> mysql-uroot-p-hlocalhost -- default-character-set = sjis database instance name <DDL file storage path (absolute path)/script_mysql. SQL
(You can copy multiple DDL statements at a time to improve productivity)

 

 

 

 

 

 

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.