安装过程中还遇到了一个问题
无法安装mysql-InvalidGPGKeyfromfile:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
这里参考了
http://www.iyunv.com/database/201701/586216.html
即将文件/etc/yum.repos.d/mysql-community.repo中的gpgcheck=1改成gpgcheck=0即可.
这是为什么上面的文件与链接A中的文件内容不同的原因.
启动mysql
systemctl start mysqld.service
初次安装mysql是root账户是没有密码,需要设置一下,
mysql -h localhost -u root -p进入mysql
设置密码的时候遇到了问题
mysql> set password for ‘root’@‘localhost’ = password('123456');
ERROR 1133 (42000): Can't find any matching row in the user table
解决方法
mysql> grant all on mysql.user to 'root'@'%' identified by 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> update mysql.user set password=password('123456') where user ='root';