#以下这条命令是解决云模板中的MariaDB与MySQL相关软件包冲突问题
Yum Remove mariadb*-y
#安装启动MySQL数据库服务器
Yum Install Mysql-server-y
#如果使用的是MariaDB, the following command changed to service MySQL start
Service MySQLd start
#设置数据库管理员初始密码为password
MySQLadmin -u root password ' password '
#开启防火墙数据库相关端口
Iptables-i input-p TCP--dport 3306-j ACCEPT
Service Iptables Save
#如果使用的是MariaDB, the following command changes to Chkconfig MySQL on
Chkconfig mysqld on
Connection failed using MySQL tool:
1130-host isn't allowed to connect to this MySQL server
Remote connection is not turned on
Solution:
#使用root登录mysqlmysql-uroot-ppassword>use MySQL; #更改user表 >update user Set host = '% ' where user = ' root '; #验证结果 >sel ECT host, user from user;+-----------+------+| Host | user |+-----------+------+|% | root | | 127.0.0.1 | root | | centos | | | centos | root | | localhost |
|+-----------+------+5 rows in Set (0.00 sec)
Minimalist Create MySQL Database