CentOS 7 mysql安裝及遠程鏈接
# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
問題:
Removing mariadb-libs.x86_64 1:5.5.56-2.el7 - u due to obsoletes from mysql-community-libs.x86_64 0:5.6.38-2.el7 - u
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.56-2.el7 will be an update
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be an update
---> Package mariadb-server.x86_64 1:5.5.56-2.el7 will be an update
--> Processing Dependency: mariadb-server for package: akonadi-mysql-1.9.2-4.el7.x86_64
--> Finished Dependency Resolution
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.6.38-2.el7.x86_64 (mysql56-community)
Not found
Updated By: 1:mariadb-server-5.5.56-2.el7.x86_64 (base)
mariadb-server = 1:5.5.56-2.el7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
報錯原因 :軟件包依賴 mariadb組件
解決方案:
#yum -y remove mariadb-libs
再次運行
#yum install mysql-community-server
配置mysql
#service mysqld restart
#mysql -u root
mysql> set password for 'root'@'localhost' =password('your password');
Query OK, 0 rows affected (0.00 sec)
mysql> use mysql;
Database changed
mysql> grant all privileges on *.* to root@'%' identified by "password";
Query OK, 0 rows affected (0.00 sec)
mysql>FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
開機啓動
shell> systemctl enable mysqld
shell> systemctl daemon-reload