How to use Navicat for MySQL to connect to a local database and import data files

Source: Internet
Author: User

How to use Navicat for MySQL to connect to a local database and import data files

1. Introduction

Navicat for MySQL is a database management tool designed to simplify, develop, and manage MySQL. We can use Navicat for MySQL to connect to a remote database, or to connect to a local database. Using this tool, it is very convenient to view the table's data, or you can enter a SQL command to implement the query. However, it is not convenient to enter commands such as creating a table. Well, let's take a look at how to use Navicat for MySQL to create and query data in the database.

2. Connect to the database

First, you have to confirm that you have installed MySQL Server 5.1 and navicat for MySQL. This installation is very simple, many tutorials on the web, and the installation of general software almost. When installing MySQL Server 5.1, be aware of the option to select the character encoding gb2312 (Chinese). Well, the installation here will not say.

After installation, open the MySQL commend Line Client and enter the password, such as:



Now we're in the MySQL command window. We can create a database and a table here:

Mysql> CREATE DATABASE mydata;mysql> use mydata;mysql> CREATE TABLE Studentscore       (name varchar) PRI Mary Key, number       int (TEN),       Department varchar (+),       gender varchar (ten),       birth int (ten),       score Int (ten))       ;

Results such as:



The above lines have created a MyData database with a Studentscore table with the following columns: Name, number, department, gender, birth, score. Each type and primary key are also defined.


3. Importing data files using Navicat for MySQL

Open navicat for MySQL, and localhost local database connection, we can see the database and table just created, such as:



We can import the local TXT data file, as follows: (Here I delve not very deep, before all have been using remote database, import local TXT file to try, yes, attention to maintain the correct format)



The next step to note, if your database has Chinese data, the encoding format must choose to be Chinese GB2312.



The spacer is then a space (depending on the case in TXT). and select the target table, corresponding to each column one by one, you can import, such as:






How to use Navicat for MySQL to connect to a local database and import data files

Related Article

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.