当前位置:网站首页>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 mysqld
2.7 其他(Service restart commands, etc)
su - mysqlservice mysqld start/stop/restart
END/历史推荐:
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!
边栏推荐
- spark source code - task submission process - 1-sparkSubmit
- 通过反射获取Class对象的四种方式
- 云计算——osi七层与TCP\IP协议
- LeetCode面试题
- Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images
- ROS2下使用ROS1 bag的方法
- Browser Storage WebStorage
- 技术分享杂七杂八技术
- disabledDate 日期选择器 datePicker
- 网络布线与数制转换
猜你喜欢
单臂路由实验和三层交换机实验
NIO工作方式浅析
disabledDate 日期选择器 datePicker
The problem come from line screening process
From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
网络布线与数制转换
vim教程:vimtutor
IP地址及子网的划分
[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves
Getting Started Doc 06 Adding files to a stream
随机推荐
spark source code-RPC communication mechanism
By solving these three problems, the operation and maintenance efficiency will exceed 90% of the hospital
千亿IT运维市场,产品要凭实力说话
Mongodb查询分析器解析
js dynamically get screen width and height
The Servlet to jump to the JSP page, forwarding and redirection
Wireshark packet capture and common filtering methods
ROS video tutorial
Tencent greetings function SCF - entry instructions
静态路由
time complexity and space complexity
传输层协议
Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
[issue resolved] - jenkins pipeline checkout timeout
传输层协议(TCP3次握手)
The problem of calling ds18b20 through a single bus
Does flink cdc currently support Gauss database sources?
CIPU, what impact does it have on the cloud computing industry?
Network wiring and digital-to-system conversion
正则表达式小示例--获取重复最多的字符及其数量