Import MySQL Database

Source: Internet
Author: User

    • Mysql5.7.11 installation -Yum mode:

1,mysql official website download mysql yum repo file (rpm file), after installation in the system /ETC/YUM.REPO.D directory more than 2 a file

2.yum search MySQL

3.Yum Install mysql-community-server.x86_64 (mysql Community Edition)

    • After the new installation of MySQL no root password can not log on the problem:

1.systemctl Stop mysqld.service shutdown MySQL Service

2.VI/ETC/MY.CNF add skip-grant-tables below mysqld, restart the MySQL service systemctl start mysqld.service

3. Login Mysql,mysql-u root without password to enter directly

4. Enter Update user set Authentication_string=password (' password ') where user= ' root ' and host= ' localhost ';

5. After successful input flush privileges;

6.exit exiting MySQL

7.VI/ETC/MY.CNF skip-grant-tables A sentence delete save to quit restarting the MySQL service

8. Re-login mysql,mysql-u root-p Enter the password you just filled in

9. After the successful login, your operation may appear the following two sentences

Your password does not satisfy the current policy requirements

You must reset your password using the ALTER USER statement before executing this statement.

Go to MySQL execute command: alter user ' root ' @ ' localhost ' identified by ' password '

=====================

Show databases;

Create dbname;

Use dbname;

Set names UTF8;

Mysql-u root-p dbname<script.sql;

Import MySQL Database

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.