Online installation Successful pro-Test
Refer to the blog address: 51741175
Thank you so much!!! It was a great help to me!!!
===========================================================================================================
Update Software
update
Download and add warehouses
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmsudo rpm -ivh mysql-community-release-el7-5.noarch.rpmyum update
Install MySQL
start mysqld
Configure MySQL
Run the following script file
mysql_secure_installation
Prompt for root password, initially null, enter to set the root password
Then you will be prompted with a series of questions, choose Y or N according to your needs.
Connect to MySQL
-uroot -p
View MySQL's encoding and modify
#查看mysql的编码mysql>show variables like ‘%character%‘;
You can see that both the database and the server encoding are latin1, and we modify it to UTF8
#1.将my-default.cnf 拷贝到 /etc/my.cnf 根据情况找到自己的目录cp /usr/share/doc/mysql-community-server-5.6.31/my-default.cnf /etc/my.cnf#2.编辑/usr/my.cnf在[client](如果没有就自己加)下增加default-character-set = utf8#3.编辑/usr/my.cnf在[mysqld]下增加character_set_server = utf8#4.重启MySql服务 这句代码和之前使用的net start mysql作用应该是一样的 开启服务 centos7使用以下代码systemctl restart mysql.service#5.重现连接mysql并查看编码如下:mysql -uroot –prootmysql>show variables like ‘%character%‘;
Allow remote logins
Log in to MySQL with the root user
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘root‘;FLUSH PRIVILEGES;
Open 3306 Ports
firewall-cmd --zone=public --add-port=3306/tcp --permanentfirewall-cmd --reload
Install MySQL online under CentOS7