在Centos 7 上面 安装MySQL 5.7 简录

In a web browser, visit mysql.com page:

https://dev.mysql.com/downloads/repo/yum/

Locate the desired version, and update it as needed in the link below:

Screencapture highlighting current yum repo name

Execute the following command

  dnf install mysql-server

enable mysql services:

  systemctl enable mysqld

start mysql services

  systemctl start mysqld

In Percona 5.7, the temporary password is stored in /var/log/mysqld.log so you can find it by:

  grep 'temporary password' /var/log/mysqld.log

After that, you can start mysql

  sudo systemctl start mysql
  sudo /usr/bin/mysql_secure_installation

and use your temporary password to use.

stop mysql service

  systemctl stop mysqld

view mysql status

  systemctl status mysqld

using the new account remote login to mysql 5.7

  use mysql;
  select user,host from user;  

  drop user 'root'@'localhost';
  CREATE USER 'admin'@'%' IDENTIFIED BY 'you password';

  GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%'  IDENTIFIED BY 'you password';

  FLUSH PRIVILEGES;

 
原文地址:https://www.cnblogs.com/kzwrcom/p/6478060.html