环境说明
系统 |
数据库 |
IP |
CentOS7 |
Mysql5.7 |
192.168.15.6 |
安装
[root@node04 ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
[root@node04 ~]# yum -y install mysql-community-release-el7-5.noarch.rpm
[root@node04 ~]# yum -y update
[root@node04 ~]# yum install mysql-server
异常:
Error: Package: akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda)
Requires: mariadb-server
Removing: 1:mariadb-server-5.5.52-1.el7.x86_64 (@anaconda)
mariadb-server = 1:5.5.52-1.el7
Obsoleted By: mysql-community-server-5.7.19-1.el7.x86_64 (mysql57-community)
Not found
------------------------------------------------------------------------------------------------------------------------------
使用yum 命令先卸载掉mariadb
[root@node04 ~]# yum -y remove mariadb-libs.x86_64
[root@node04 ~]# yum install mysql-server
使用
[root@node04 ~]# service mysqld start
授权
[root@node04 ~]# mysql
mysql -uroot
mysql> use mysql
mysql> show tables;
mysql> select user,host,password from user;
mysql> delete from user;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
mysql> flush privileges;
mysql> exit
[root@node04 ~]# mysql -uroot -proot