当前位置:网站首页>Install mysql5.7 under centos7
Install mysql5.7 under centos7
2022-07-28 10:31:00 【Code Hamal】
Centos7 install and configure MySQL5.7
1、 download mysql Of rpm package
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
2、 install mysql Install source
yum -y localinstall mysql57-community-release-el7-11.noarch.rpm
3、 Online installation mysql
yum -y install mysql-community-server
Download more things , Please be patient
4、 start-up MySQL service
systemctl start mysqld
5、 Set boot up
systemctl enable mysqld
systemctl daemon-reload
6、 modify root The login password
mysql After installation , Will be in /var/log/mysqld.log In the document root Generated a temporary default password .
vim /var/log/mysqld.log

Copy this password , Use this password to log in root
[[email protected] ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Change Password , mysql5.7 The default password policy requires that the password must be a combination of upper and lower case alphanumeric special letters , At least 8 position
ALTER USER 'root'@'localhost' IDENTIFIED BY '[email protected]';
Allow remote login
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '[email protected]' WITH GRANT OPTION;
Refresh the permissions
flush privileges; # Refresh current configuration
7、 Configure firewall
# 1> to open up 3306 port ( Use under virtual machine , Please configure services for ECS )
# Set up iptables service
yum -y install iptables-services
# If you want to modify the firewall configuration , For example, add firewall port 3306
vi /etc/sysconfig/iptables
# Add rules
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT # Save after exit
# Configure firewall :
systemctl restart iptables.service # Restart the firewall for the configuration to take effect
systemctl enable iptables.service # Set the firewall to power on
8、 To configure mysql The default encoding is utf-8
modify /etc/my.cnf The configuration file , stay [mysqld] Add coding configuration
character_set_server=utf8
init_connect=‘SET NAMES utf8’
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-fS0DXShX-1602230947110)(.\mysql57 install \ To configure mysql The default encoding is utf-8.png)]
9、 restart mysqld
systemctl restart mysqld
ES utf8’
[ Outside the chain picture transfer in …(img-fS0DXShX-1602230947110)]
9、 restart mysqld
systemctl restart mysqld
边栏推荐
- SQL Server 2016 学习记录 --- 数据定义
- 中兴通讯:5nm 5G基站芯片正在技术导入!
- 逆元&组合数&快速幂
- Vulnerability analysis hevd-0x8.integeroverflow[win7x86]
- 数据库安全 --- 创建登录名 用户+配置权限【笔记】
- 华为入股石墨烯材料厂商富烯科技,持股10%
- 第一篇:UniAPP的小程序跨端开发-----创建uniapp项目
- C language secondary pointer explanation and example code
- Database security - create login user + configure permissions [notes]
- ZTE: 5nm 5g base station chip is being introduced!
猜你喜欢
![[wechat applet] project practice - lottery application](/img/7b/a0545f077259b3dc971dc246813177.png)
[wechat applet] project practice - lottery application

15、判断二维数组中是否存在目标值

SQL Server 2016学习记录 --- 单表查询

配置树莓派,过程和遇到问题

第一篇:UniAPP的小程序跨端开发-----创建uniapp项目

5. Dynamic programming -- Fibonacci series

SQL Server 2016学习记录 --- 连接查询

CentOS7下安装mysql5.7

C language secondary pointer explanation and example code

Aqua Data Studio 18.5.0 export insert statement
随机推荐
6、双指针——递增数组两数之和与目标数相等
Step 4 - user development environment settings
简介
12. Double pointer -- merge two ordered linked lists
SDUT 2446 最终排名
利用正则表达式从文件路径中匹配文件名
SQL Server 2016 学习记录 --- 集合查询
15、判断二维数组中是否存在目标值
SQL Server 2016 学习记录 ---视图
Uni app advanced creation component / native rendering
死锁算法:银行家算法和安全性算法
Aqua Data Studio 18.5.0导出insert语句
用K-means聚类分类不同行业的关税模型
SQL Server 2016 学习记录 --- 数据定义
SQL Server 2016 learning records - data update
中兴通讯总裁徐子阳:5nm芯片将在2021年推出
2. 输出数组中重复的数字之一
CentOS7下安装mysql5.7
IDEA创建我的第一个项目
Aqua Data Studio 18.5.0 export insert statement