在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要在系统中安装MySQL,而且安装完成之后可以直接覆盖掉MariaDB。
安装操作
[root@bogon ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
[root@bogon ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm
[root@bogon ~]# yum -y install mysql-community-server
启动操作
[root@bogon ~]# systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@bogon run]# rm -rf /var/lib/mysql
[root@bogon run]# service mysqld restart
启动后进行连接:
[root@bogon run]# mysql -uroot -p
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A mysql> UPDATE user SET authentication_string=PASSWORD("123456") WHERE user=‘root‘; Query OK, 1 row affected, 1 warning (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 1
【MySQL】Centos7 yum安装MySQL5.7.25
原文:https://www.cnblogs.com/boluopabo/p/12896743.html