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

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 a local database. You can use this tool to conveniently View table data. You can also enter an SQL command to perform queries. However, it is not convenient to enter commands such as create table. 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, make sure that you have installed MySQL Server 5.1 and navicat for mysql. This installation is very simple. There are many tutorials on the Internet, which are similar to installing common software. Only when installing MySQL Server 5.1, You must select the character encoding gb2312 (Chinese) option. Well, I won't talk about installation here.

After installation, open MySql Commend Line Client and enter the password, for example:



Now we enter the MySql Command window. Here we can create a database and a table:

mysql> create database mydata;mysql> use mydata;mysql> create table StudentScore       -> (name varchar(10) primary key,       -> number int(10),       -> department varchar(10),       -> gender varchar(10),       -> birth int(10),       -> score int(10)       -> );

The result is as follows:



The above commands have already created a mydata database with a StudentScore table. The table contains the following columns: name, number, department, gender, birth, score. each type and primary key are also defined.


3. Use navicat for mysql to import data files

Open navicat for mysql and connect to the localhost local database. We can see the database and table we just created, for example:



We can import local txt data files, as shown in the following figure: (I have not studied it very deeply. I have been using remote databases all the time before. I tried importing local txt files. Yes, make sure that the format is correct)



Note that if your database contains Chinese data, You must select GB2312. for example:



The Delimiter is a space (based on the specific circumstances in the txt file ). Select the target table and match each column to import the table, for example:






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.