MySQL database import SQL file in CentOS

Source: Internet
Author: User
Tags mysql client create database

1. For the import of files, under CentOS is the first to create a new database with the same name as the file.

mysql>create database Student;

2. Switch to the database where you want to import the SQL file

use Student;

3. If there are no errors, the instructions are entered into your new database. Then set the code first:

mysql>set names utf8;

4. Then enter the location of the database text Student.sql file you imported into CentOS

mysql>source /usr/database.sql;   文件相同名字的数据库

5. Then you'll see the success of many query statements on the screen, then OK.


6. At this time through the local MySQL client is unable to log on to the remote server Linux MySQL, need to authorize a bit

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘youpassword‘ WITH GRANT OPTION;

MySQL database import SQL file in CentOS

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.