当前位置:网站首页>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
边栏推荐
猜你喜欢

15. Judge whether the target value exists in the two-dimensional array

CentOS7下安装mysql5.7
![Database security - create login user + configure permissions [notes]](/img/02/0c3eb542593e8e0a3a62db75c52850.png)
Database security - create login user + configure permissions [notes]

机器学习--手写英文字母2--导入与处理数据

AP Autosar平台设计 1-2 导言、技术范围与方法

IDEA创建我的第一个项目

SQL Server 2016 learning records - connection query

SuperMap iserver publishing management and calling map services

多线程与高并发(三)—— 源码解析 AQS 原理

Sword finger offer
随机推荐
11、链表反转
利用正则表达式从文件路径中匹配文件名
Lucene 查询语法备忘
Step 4 - user development environment settings
brief introduction
ACM寒假集训#4
数据库安全 --- 创建登录名 用户+配置权限【笔记】
Small knowledge in Oracle
字符串匹配
13. Hash table - the first common node of two linked lists
配置树莓派,过程和遇到问题
Deadlock algorithm: banker algorithm and security algorithm
Idea create my first project
Get to know SuperMap idesktop for the first time
(1)机器学习概念总结
9. Delete nodes in the linked list
Uni app advanced creation component / native rendering
15、判断二维数组中是否存在目标值
Sleeping barber problem
pt-kill 查询中包含中文字符 导致工具失效的排查