Install MySQL online under CentOS7

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.