Navicat is a set of fast, reliable and relatively cheap database management tools, designed to simplify database management and reduce system management costs. Below we will introduce to you how to use naviact to export the database.
Recommended tutorial: navicat graphic tutorial
Use Navicat to connect to mysql, and then select what you want to export Right-click on the database, select Dump SQL File..., name it as data name.sql, and save it locally. As shown below:
●Select the dump SQL file...
●Save to local: database name.sql
●Save successfully
Contents in usersinfo.sql:
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50508 Source Host : localhost:3306 Source Database : usersinfo Target Server Type : MYSQL Target Server Version : 50508 File Encoding : 65001 Date: 2018-07-03 15:42:50 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `student` -- ---------------------------- DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `学号` varchar(20) NOT NULL DEFAULT '', `姓名` varchar(20) DEFAULT NULL, `性别` varchar(20) DEFAULT NULL, `专业` varchar(40) DEFAULT NULL, `年级` varchar(20) DEFAULT NULL, `出生` varchar(255) DEFAULT NULL, `课程` varchar(255) DEFAULT NULL, `成绩` double DEFAULT NULL, PRIMARY KEY (`学号`) ) ENGINE=InnoDB DEFAULT CHARSET=gbk; -- ---------------------------- -- Records of student -- ---------------------------- INSERT INTO `student` VALUES ('B1', '小丽', '男', '计算机科学与技术', '大二', '1996', '高等数学', '500'); INSERT INTO `student` VALUES ('H1000', '小郭', '女', '计算机科学与技术', '大二', '1999', '高等数学', '100'); INSERT INTO `student` VALUES ('H1234', '小兰', '男', '计算机科学以与技术', '大三', '1997', '高等数学', '200');
You can see that the above are all sql Statements include statements that create a table and statements that insert rows of data into the table. Note that usersinfo.sql only contains information about the tables in the original usersinfo database, and no information about the database itself. Therefore, when we import the sql file later, we need to first create a database named: "usersinfo".
The above is the detailed content of How to export the database in navicat. For more information, please follow other related articles on the PHP Chinese website!