当前位置:网站首页>Complete mysql offline installation in 5 minutes
Complete mysql offline installation in 5 minutes
2022-08-05 06:20:00 【Sun Wenwen】
1. 场景描述
mysqlOffline installation is not complicated,It's just that there are often leaks,Sometimes for half a day,总结下,快速离线安装mysql,Just type the following command directly,5-10Install in minutes.

2. 解决方案
安装的mysql版本为:5.7,官网下载的gz包为:mysql-5.7.24-el7-x86_64.tar.gz.
2.1 安装
Mainly upload files、解压、Create new users, etc..
2.1.1 详细命令
1. gz文件上传到目录: /usr/local/2. 解压 cd /usr/local/ tar -zxvf mysql-5.7.24-el7-x86_64.tar.gz mkdir mysql mv mysql-5.7.24-el7-x86_64/* mysql rm -rf mysql-5.7.24-el7-x86_64 rm -rf mysql-5.7.24-el7-x86_64.tar.gz 3.新建mysql用户 groupadd mysql //创建用户组 useradd -r -g mysql mysql //-r参数表示mysql用户是系统用户,Not available for login,Create users and add user groups chown -R mysql mysql/ chgrp -R mysql mysql/2.1.2 效果图

2.2 配置参数
主要是配置my.cnf文件
2.2.1 详细命令
vi /etc/my.cnf内容如下,You can add the configuration you need:[client]port = 3306socket = /tmp/mysql.sock[mysqld]character_set_server=utf8init_connect='SET NAMES utf8'basedir=/usr/local/mysqldatadir=/usr/local/mysql/datasocket=/tmp/mysql.socklog-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid#不区分大小写lower_case_table_names = 1sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONmax_connections=5000default-time_zone = '+8:00'保存内容,按esc输入如下命令:wq!2.2.2 效果图:

2.3 初始化命令
---------------20191023更新-----------
Go back and use the tutorial to install again,Two pits were found,记录下,root账户执行
yum install libaiocd /var/log/vi mysqld.log:wqchmod 777 mysqld.logchown mysql:mysql mysqld.log-----------------------cd /var/run/mkdir mysqldchmod 777 mysqldcd mysqldvim mysqld.pidchmod 777 mysqld.pidchown mysql:mysql mysqld.pid 然后再执行初始化:
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --lc_messages_dir=/usr/local/mysql/share --lc_messages=en_US执行成功后,View the default initialization password
查看初始密码cat /var/log/mysqld.logBasically the last place:A temporary password is generated for [email protected]: B2iSyfs;d(dT其中B2iSyfs;d(dT,就是初始密码([email protected]: 这里就是初始密码)2.4 完成配置,启动服务
使用mysql用户启动
su - mysql输入密码/usr/local/mysql/support-files/mysql.server start启动完成后,可以用pscommand to see if it has started successfully.

2.5 远程连接
mysql服务启动完成后,By default the remote client cannot connect,需要在linux环境下登录mysql,并执行相关命令.
/usr/local/mysql/bin/mysql -uroot -p mysql输入root密码:(B2iSyfs;d(dT)set password=password('laowang');UPDATE mysql.user SET Host = '%', User = 'root' WHERE (Host = 'localhost') AND (User = 'root');FLUSH PRIVILEGES;2.6 设置开机自动启动
cd /usr/local/mysql/support-filescp mysql.server /etc/init.d/mysqldchkconfig --add mysqld2.7 其他(Service restart commands, etc)
su - mysqlservice mysqld start/stop/restartEND/历史推荐:
1. Registration center and gateway selection and complete deployment in the era of microservices
2. Alibaba Cloud's data center
3. springcloud-路由网关Zuul
4. Back-end separation before software developmentSwagger2
5. 数据库架构介绍
6. rabbitmq部署及使用
I’m 「软件老王」,IT技术及相关干货分享,If you like my article, please follow and forward it!

边栏推荐
- [Paper Intensive Reading] The relationship between Precision-Recall and ROC curves
- Apache configure reverse proxy
- 有哪些事情是你做了运维才知道的?
- 传输层协议(TCP3次握手)
- Mina断线重连
- sql server 重复值在后面计数
- 带你深入了解Cookie
- Regular expression small example - get number character and repeated the most
- Growth: IT Operations Trends Report
- Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
猜你喜欢
随机推荐
ROS video tutorial
Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
[ingress]-ingress使用tcp端口暴露服务
Hugo builds a personal blog
Will intelligent operation and maintenance replace manual operation and maintenance?
运维工程师,快来薅羊毛
By solving these three problems, the operation and maintenance efficiency will exceed 90% of the hospital
Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images
跨域的十种解决方案详解(总结)
Apache configure reverse proxy
VLAN详解及实验
Transport layer protocol (TCP 3-way handshake)
The spark operator - coalesce operator
网络不通?服务丢包?看这篇就够了
Billions of IT operations in the market, the product by strength to speak
微信小程序页面跳转传参
云计算——osi七层与TCP\IP协议
spark operator-textFile operator
从“双卡双待“到”双通“,vivo率先推动DSDA架构落地
Mongodb查询分析器解析





![[Day8] Commands involved in using LVM to expand](/img/ba/39b81cbcecec9bc54a710ff9dba81a.png)



