当前位置:网站首页>CentOS install MySQL 5.7.38
CentOS install MySQL 5.7.38
2022-07-21 21:43:00 【Rocky000000】
1、 download MySQL Installation package
Download what you need rpm package https://dev.mysql.com/downloads/mysql/
2、 Check if it is installed mysql perhaps mariadb
[[email protected] ~]# rpm -qa | grep mysql
[[email protected] ~]# rpm -qa | grep mariadb
If installed , The above command will check the relevant installation information , Unload it
# uninstall MySQL
rpm -qa | grep mysql | xargs rpm -e --nodeps
# uninstall mariadb
rpm -qa | grep mariadb| xargs rpm -e --nodeps
3、 Install in sequence as follows 4 Just one file
[[email protected] mysql]# rpm -ivh mysql-community-common-5.7.38-1.el7.x86_64.rpm
[[email protected] mysql]# rpm -ivh mysql-community-libs-5.7.38-1.el7.x86_64.rpm
[[email protected] mysql]# rpm -ivh mysql-community-client-5.7.38-1.el7.x86_64.rpm
[[email protected] mysql]# rpm -ivh mysql-community-server-5.7.38-1.el7.x86_64.rpm
In the installation server When you file , It may also prompt that other dependent packages are missing , such as :net-tools, Download the relevant dependent packages one by one according to the prompts and install , After all dependencies are solved , Install again mysql-community-server This rpm file . The missing dependency package is recommended to download here :https://centos.pkgs.org/7/centos-x86_64/
thus ,mysql5.7 All files are installed , The next step is to start the service .
4、 Modify the configuration file
Modify the configuration file my.cnf, Set password free login
[[email protected] ~]# vim /etc/my.cnf
### You can refer to the following
[mysql]
default-character-set=utf8
[mysqld]
datadir=/data/mysql
socket=/data/mysql/mysql.sock
slow_query_log = ON
slow_query_log_file = /var/log/mysql_slow_query.log
long_query_time = 3
symbolic-links=0
log-error=/data/mysql/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log-bin=mysql-bin
thread_cache_size=100
server-id=33
back_log=500
lower_case_table_names=1
#thread_concurrency=80
#thread_concurrency=32
query_cache_limit=12M
query_cache_size=512M
query_cache_type=1
character-set-server=utf8mb4
max_connections=3000
innodb_buffer_pool_size=12G
innodb_file_per_table=ON
innodb_log_file_size=3G
expire_logs_days=5
read_only=1
lower_case_table_names=1
skip-name-resolve
[client]
socket=/data/mysql/mysql.sock
5、 start-up MySQL
systemctl restart mysqld
It takes a long time to start , It takes patience , Expected again 10 About minutes , Because you need to initialize the database .
6、 see MySQL Initial password
adopt my.cnf File found /data/mysql/mysqld.log file , In the revised document according to password Keyword query initial password
# see log-error Specified data directory
[[email protected] ~]# cat /etc/my.cnf | grep log-error
log-error=/data/mysql/mysqld.log
# Check initialization password
[[email protected] ~]# cat /data/mysql/mysqld.log | grep localhost
2022-07-05T16:48:26.206485Z 1 [Note] A temporary password is generated for [email protected]: B9eldAjOiu=(
After checking the password , You can use this password to log in to MySQL, And follow up
7、 Sign in MySQL
[[email protected] ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.38-log MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> set global validate_password_policy = 0;
Query OK, 0 rows affected (0.00 sec)
mysql> SET PASSWORD = PASSWORD('root');
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
installation is complete !
边栏推荐
- SREWorks持续交付云原生化: 镜像构建
- Partition tables in azure synapse Analytics (dedicated SQL pool)
- Common sense of cross platform framework fluent and RN
- [MySQL] the background of multi table connection in mysql, the error of Cartesian product and how to correctly query multiple tables
- Dart pragma annotation VM: entry point
- Flutter's learning path - Summary
- Manually build APK process
- 阿里云机器学习平台PAI论文高效大模型训练框架Whale入选USENIX ATC‘22
- 高质量文章导航
- VMware has the problem of "this virtual machine seems to be in use"
猜你喜欢
RK 接入调试串口后重复重启问题定位
Camera摄像头工作原理
Location of repeated restart after rk is connected to the debugging serial port
Impala-shell exports the more than 9 million level table on kudu (below)_ Complete transmission
【机器学习】两分钟论文导读:基于深度学习的3D地形生成器
Remember the problem caused by kotlin using remove in mutablelist once
开发者玩转机学习不能错过的15篇深度文章
01 learn how to understand the SQL server execution plan - basic knowledge
Actual combat of flutter - customized keyboard (I)
Understand the problem of static library / dynamic library link in one article
随机推荐
YOLO7环境搭建、代码测试
笔记目录
Multi camera fusion in mobile phones
Is there any need for livedata to learn—— Jetpack series (2)
The wonderful journey of quantum mechanics - operators and electron spin
Query SQL deadlock details on azure SQL db/mi
[SQLite3 database]
Wonderful journey of quantum mechanics - pre preparation
[leeco cloud learning notes] after the video of LETV leeco cloud on demand is paused, press home to return to the desktop and then onresume to return to activity. The video will be played automaticall
Broadcasts
你的第一个 Jenkins 项目,从这里开始
Install PostgreSQL on centos7
Flutter实战-WidgetsFlutterBinding
GIS - common geographical coordinate system in China
Power supply integrity from DC Perspective
阿里云机器学习平台PAI论文高效大模型训练框架Whale入选USENIX ATC‘22
openssl+poly1305+sm4实现
Kotlin basic data type
PostgreSQL ShapeFile import and export
[wechat applet learning notes] two positions of pop-up window