- 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