Add 1 million data to the text document, with 8 fields per data, respectively:
Id Int (one) NOT NULL primary key auto_increment
Name varchar (40)
Age Int (11)
Sex Char (5)
Salary Int (11)
Phone varchar (13)
Email varchar (+) NOT NULL
Address varchar (64)
How to import and export data for 1.MySQL text files
Import data: (input in MySQL console)
Load data local infile "E:/data.txt"
into table person (name,age,sex,salary,phone,email,address);
Export data: (input in MySQL console)
Select Name,age,sex,salary,phone,email,address
into outfile "E:/data_out.txt"
Lines terminated by "\ r \ n"
from person;
2. Import and export using Mysqldump.exe in MySQL (Find Mysqldump.exe in MySQL, run with Win32)
To back up the MySQL database command:
Mysqldump-uusername-ppassword databasename >e:/Backup.sql
Restore MySQL database commands (find Mysqldump.exe in MySQL, run with Win32)
(1) Mysql-uusername-ppassword DatabaseName < e:/backup.sql
(2) using the source command in the MySQL console (entered in the MySQL console)
Mysql>source E:/backup.sql
Compress the MySQL database directly (find Mysqldump.exe in MySQL and run with Win32)
Mysqldump-uusername-ppassword DatabaseName | gzip > backup.sql.gz
Backup MySQL database (find Mysqldump.exe in MySQL, run with Win32)
Mysqldump-uusername-ppassword databasename tablename > e:/backup.sql
Restore a compacted MySQL database
Gunzip < backupfile.sql.gz | Mysql-uusername-ppassword DatabaseName
3. Transfer the database to the new server
Copy the Data folder from MySQL to the new server and configure the permissions
The data in MySQL is stored in the Files folder, and the default is C:/programdata/mysql/mysql Server 5.5/data/.
You can also view it from the Mysql.ini configuration file
#Path to the database root
Datadir= "C:/programdata/mysql/mysql Server 5.5/data/"