MySQL 8 二进制文件安装
概述mysql官方 https://www.mysql.com/社区版下载地址 https://dev.mysql.com/downloads/检查是否安装mariadb如果有先卸载rpm-qa|grepmariadb[rootCentos7-2243 config]# rpm -qa|grep mariadbmariadb-libs-5.5.68-1.el7.x86_64[rootCentos7-2243 config]# yum remove -y mariadb-libs-5.5.68https://dev.mysql.com/downloads/mysql/tar-xvfmysql-8.4.2-linux-glibc2.17-x86_64.tar.xzmvmysql-8.4.2-linux-glibc2.17-x86_64 /usr/local/mysql8.4.2useradd-s/sbin/nologin mysql安装依赖yuminstalllibaio-devel libaio-develcd/usr/local/mysql8.4.2mkdir/public/mysqldb/datamkdir/public/mysqldb/logsmkdir/public/mysqldb/tmpmkdir/etc/mysql增加环境变量vim/etc/profileexportMYSQL_HOME/usr/local/mysql8.4.2/PATH$MYSQL_HOME/bin:$PATHexportPATHsource/etc/profile简单配置my_3306.cnfvim/etc/mysql/my_3306.cnf# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/8.2/en/server-configuration-defaults.html[mysqld]## Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.# innodb_buffer_pool_size 128M## Remove the leading # to disable binary logging# Binary logging captures changes between backups and is enabled by# default. Its default setting is log_binbinlog# disable_log_bin## Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.# join_buffer_size 128M# sort_buffer_size 2M# read_rnd_buffer_size 2M## Remove leading # to revert to previous value for default_authentication_plugin,# this will increase compatibility with older clients. For background, see:# https://dev.mysql.com/doc/refman/8.2/en/server-system-variables.html#sysvar_default_authentication_plugin# default-authentication-pluginmysql_native_password# 设置3306端口port3306socket/public/mysqldb/tmp/mysql.sockmysqlx_socket/public/mysqldb/tmp/mysqlx.sock pid-file/public/mysqldb/tmp/mysqld.pid# 设置mysql的安装目录basedir/usr/local/mysql8.4.2# 设置mysql数据库的数据的存放目录datadir/public/mysqldb/data# 允许最大连接数max_connections10000# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统max_connect_errors10# 服务端使用的字符集默认为UTF8character-set-serverutf8mb4# 创建新表时将使用的默认存储引擎default-storage-engineINNODB# 默认使用“mysql_native_password”插件认证mysql_native_passwordON#default_authentication_pluginmysql_native_password[mysql]# 设置mysql客户端默认字符集default-character-setutf8mb4[client]# 设置mysql客户端连接服务端时默认使用的端口port3306socket/public/mysqldb/tmp/mysql.sockln-s/etc/mysql/my_3306.cnf /etc/my_3306.cnfchown-Rmysql:mysql /usr/local/mysql8.4.2chown-Rmysql:mysql /public/mysqldbchown-Rmysql:mysql /etc/mysql初始化数据库cd/usr/local/mysql8.4.2/bin ./mysqld --defaults-file/etc/my_3306.cnf--initialize--console查看临时密码greppassword/public/mysqldb/logs/mysql_3306-error.log[rootvm172-16-0-6 bin]# ./mysqld --defaults-file/etc/my_3306.cnf --initialize --console2024-08-26T09:53:04.661185Z0[System][MY-015017][Server]MySQL Server Initialization - start.2024-08-26T09:53:04.664608Z0[System][MY-013169][Server]/usr/local/mysql-8.4.2/bin/mysqld(mysqld8.4.2)initializing of serverinprogress as process310692024-08-26T09:53:04.688642Z1[System][MY-013576][InnoDB]InnoDB initialization has started.2024-08-26T09:53:06.509597Z1[System][MY-013577][InnoDB]InnoDB initialization has ended.2024-08-26T09:53:10.162534Z6[Note][MY-010454][Server]A temporary password is generatedforrootlocalhost: WXyl%a7pZms2024-08-26T09:53:13.891230Z0[System][MY-015018][Server]MySQL Server Initialization - end.启动mysql服务器./mysqld_safe --defaults-file/etc/my_3306.cnf[rootvm172-16-0-6 support-files]# netstat -nltp | grep 3306tcp600:::33060 :::* LISTEN20232/mysqld tcp600:::3306 :::* LISTEN20232/mysqld登录mysql[rootcentos7-05145 bin]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with;or\g. Your MySQL connectionidis10Server version:8.4.2 Copyright(c)2000,2024, 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. Typehelp;or\hforhelp. Type\ctoclearthe current input statement. mysql修改root密码mysqlALTERUSERrootlocalhostIDENTIFIEDWITHmysql_native_passwordBYyourpassword;mysqlusemysql;Readingtableinformationforcompletionoftableandcolumnnames You can turnoffthis featuretoget a quicker startupwith-ADatabasechanged mysqlmysqlselectuser,hostfromuser;-----------------------------|user|host|-----------------------------|root|localhost||mysql.infoschema|localhost||mysql.session|localhost||mysql.sys|localhost|-----------------------------4rowsinset(0.00sec)mysqlUPDATEUSERSEThost%WHEREuserroot;mysqlFLUSHPRIVILEGES;mysqlexit关闭mysql服务bash./mysqladmin-h127.0.0.1-u root-P3306-pshutdown配置systemd服务脚本cd/usr/local/mysql8.4.2/support-filesvimmysqld.service[Unit]DescriptionMySQL ServerDocumentationman:mysqld(8)Documentationhttp://dev.mysql.com/doc/refman/en/using-systemd.htmlAfternetwork.targetAftersyslog.target[Install]WantedBymulti-user.target[Service]UsermysqlGroupmysql# Have mysqld write its state to the systemd notify socketTypenotify# Disable service start and stop timeout logic of systemd for mysqld service.TimeoutSec0# Start main serviceExecStart/usr/local/mysql-8.4.2/bin/mysqld --defaults-file/etc/my_3306.cnf$MYSQLD_OPTS# Use this to switch malloc implementationEnvironmentFile-/etc/sysconfig/mysql# Sets open_files_limitLimitNOFILE141082Restarton-failureRestartPreventExitStatus1# Set environment variable MYSQLD_PARENT_PID. This is required for restart.EnvironmentMYSQLD_PARENT_PID1PrivateTmpfalseln-s/usr/local/mysql8.4.2/support-files/mysqld.service /etc/systemd/system/systemctl daemon-reload systemctl start mysqld登录数据库测试/usr/local/mysql8.4.2/bin/mysql-uroot-p-S/public/mysqldb/tmp/mysql.sock使用IP登录mysql bash mysql -u root -h 127.0.0.1 -pWelcome to the MySQL monitor. Commands end with;or\g. Your MySQL connectionidis16Server version:8.4.2 MySQL Community Server - GPL Copyright(c)2000,2024, 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. Typehelp;or\hforhelp. Type\ctoclearthe current input statement. mysqlselectversion;-----------|version|-----------|8.4.2|-----------1rowinset(0.00sec)

相关新闻

Super Productivity:终极开源时间管理解决方案,告别任务混乱与效率低下

Super Productivity:终极开源时间管理解决方案,告别任务混乱与效率低下

Super Productivity:终极开源时间管理解决方案,告别任务混乱与效率低下 【免费下载链接】super-productivity Super Productivity is an advanced todo list app with integrated Timeboxing and time tracking capabilities. It also comes with integr…

2026/8/1 19:51:03 阅读更多 →
7.9英寸触摸屏在树莓派、Jetson Nano与Windows上的驱动配置与进阶应用

7.9英寸触摸屏在树莓派、Jetson Nano与Windows上的驱动配置与进阶应用

1. 为什么你需要一块7.9英寸触摸屏?如果你正在捣鼓树莓派、Jetson Nano这类单板计算机,或者想给Windows小主机做个便携控制面板,又或者想DIY一个车载信息娱乐终端,那么一块7.9英寸的触摸屏很可能就是你项目里缺的那块“拼图”。这…

2026/8/1 19:51:03 阅读更多 →
ESP32-S3触摸屏开发实战:从硬件选型到GUI应用开发

ESP32-S3触摸屏开发实战:从硬件选型到GUI应用开发

1. 项目缘起:为什么是ESP32-S3-Touch-LCD-4?最近在捣鼓一个智能家居中控面板的原型,核心需求很简单:一块反应灵敏的触摸屏,能流畅地显示UI和响应交互,同时还得足够省电,最好能长时间待机。市面上…

2026/8/1 19:51:03 阅读更多 →

最新新闻

树莓派Zero W魔改千兆以太网:Package E硬件改造与网络优化实战

树莓派Zero W魔改千兆以太网:Package E硬件改造与网络优化实战

1. 项目缘起:为什么是“Package E”? 最近在整理工作室的旧设备,翻出来几块吃灰已久的树莓派 Zero W。这玩意儿当年可是个“网红”,以极低的功耗和成本,加上内置的Wi-Fi和蓝牙,成了无数DIY爱好者和轻量级物…

2026/8/1 20:29:23 阅读更多 →
为什么选择librarian-puppet?10个理由让你的基础设施即代码更可靠

为什么选择librarian-puppet?10个理由让你的基础设施即代码更可靠

为什么选择librarian-puppet?10个理由让你的基础设施即代码更可靠 【免费下载链接】librarian-puppet 项目地址: https://gitcode.com/gh_mirrors/li/librarian-puppet librarian-puppet是一款强大的Puppet模块管理工具,能够帮助开发者高效管理基…

2026/8/1 20:29:23 阅读更多 →
如何快速配置Wand增强工具:完整操作指南解锁游戏无限体验

如何快速配置Wand增强工具:完整操作指南解锁游戏无限体验

如何快速配置Wand增强工具:完整操作指南解锁游戏无限体验 【免费下载链接】Wand-Enhancer Advanced UX and interoperability extension for Wand (WeMod) app 项目地址: https://gitcode.com/GitHub_Trending/we/Wand-Enhancer 还在为Wand(原WeM…

2026/8/1 20:29:23 阅读更多 →
腾讯云数据库AgentMemory团队知识管理实践

腾讯云数据库AgentMemory团队知识管理实践

腾讯云数据库Agent Memory团队知识管理实践 开篇:从记忆基础设施到团队知识资产化 随着大模型从单轮对话走向多智能体协同与长周期任务执行,上下文断裂、跨会话失忆与知识无法沉淀,已成为制约企业 Agent 规模化落地的核心瓶颈。权威 AI 产业研…

2026/8/1 20:29:23 阅读更多 →
Wan2.2开源:3大技术创新,让消费级GPU也能生成高质量视频

Wan2.2开源:3大技术创新,让消费级GPU也能生成高质量视频

Wan2.2开源:3大技术创新,让消费级GPU也能生成高质量视频 【免费下载链接】Wan2.2-I2V-A14B-Diffusers 项目地址: https://ai.gitcode.com/hf_mirrors/Wan-AI/Wan2.2-I2V-A14B-Diffusers 在AI视频生成领域,技术门槛和硬件成本一直是阻…

2026/8/1 20:29:23 阅读更多 →
为什么你的AI编程CI总在凌晨失败?资深SRE披露4类隐性依赖漏洞与实时修复方案

为什么你的AI编程CI总在凌晨失败?资深SRE披露4类隐性依赖漏洞与实时修复方案

更多请点击: https://intelliparadigm.com 第一章:为什么你的AI编程CI总在凌晨失败?资深SRE披露4类隐性依赖漏洞与实时修复方案 凌晨三点,CI流水线突然红了——模型训练任务卡在 PyTorch DataLoader 初始化阶段,GPU 显…

2026/8/1 20:28:23 阅读更多 →

日新闻

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南 【免费下载链接】BaiduNetdiskPlugin-macOS For macOS.百度网盘 破解SVIP、下载速度限制~ 项目地址: https://gitcode.com/gh_mirrors/ba/BaiduNetdiskPlugin-macOS 还在为百度网盘macOS版的龟速下…

2026/8/1 0:00:48 阅读更多 →
终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换

终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换

终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换 【免费下载链接】ncmdump 项目地址: https://gitcode.com/gh_mirrors/ncmd/ncmdump 还在为网易云音乐下载的NCM格式文件无法在其他播放器播放而烦恼吗?ncmdump解密工具帮你轻松解决这个困…

2026/8/1 0:00:48 阅读更多 →
HarmonyOS 应用开发《掌上英语》第81篇: 智能体卡片:为英语学习 App 打造桌面级学习助手

HarmonyOS 应用开发《掌上英语》第81篇: 智能体卡片:为英语学习 App 打造桌面级学习助手

AgentCard 智能体卡片:为英语学习 App 打造桌面级学习助手适用平台:HarmonyOS 7.0 (API 26 Beta)一、引言 HarmonyOS 7.0(API 26 Beta)新增了 AgentCard 智能体卡片能力,这是继 HMAF(鸿蒙智能体框架&#x…

2026/8/1 0:00:48 阅读更多 →

周新闻

深度学习道路桥梁裂缝检测系统 道路桥梁裂缝检测数据集 道路桥梁病害识别检测数据集

深度学习道路桥梁裂缝检测系统 道路桥梁裂缝检测数据集 道路桥梁病害识别检测数据集

深度学习道路桥梁裂缝检测系统 数据集6000张 完整源码已标注数据集训练好的模型环境配置教程程序运行说明文档,可以直接使用!系统支持图片、视频、摄像头等多种方式检测裂缝,功能强大实用。 1数据集6000张 8各类别

2026/8/1 13:02:46 阅读更多 →
深度学习YOLO模型如何训练 PUBG 绝地求生目标检测数据集

深度学习YOLO模型如何训练 PUBG 绝地求生目标检测数据集

pubg数据集 精选原图1.42万数据 1.49万标签 无任何重复、算法增强或冗余图像! pubg绝地求生目标检测数据集 1分类:e_body,14905个标签,txt格式 共计14244张图,99%为640*640尺寸图像 适合yolo目标检测、AI训练关键词&am…

2026/8/1 5:19:34 阅读更多 →
Apex英雄目标检测数据集 深度学习框架YOLO如何训练APEX数据集

Apex英雄目标检测数据集 深度学习框架YOLO如何训练APEX数据集

Apex检测数据集数据集详情检测类别: allies enemy tag图片总量:7247张训练集:5139张验证集:1425张测试集:683张标注状态:全部已标注,即拿即用数据格式:支持YOLO格式及其他格式&#…

2026/8/1 10:33:33 阅读更多 →

月新闻

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南 【免费下载链接】BaiduNetdiskPlugin-macOS For macOS.百度网盘 破解SVIP、下载速度限制~ 项目地址: https://gitcode.com/gh_mirrors/ba/BaiduNetdiskPlugin-macOS 还在为百度网盘macOS版的龟速下…

2026/8/1 0:00:48 阅读更多 →
终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换

终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换

终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换 【免费下载链接】ncmdump 项目地址: https://gitcode.com/gh_mirrors/ncmd/ncmdump 还在为网易云音乐下载的NCM格式文件无法在其他播放器播放而烦恼吗?ncmdump解密工具帮你轻松解决这个困…

2026/8/1 0:00:48 阅读更多 →
HarmonyOS 应用开发《掌上英语》第81篇: 智能体卡片:为英语学习 App 打造桌面级学习助手

HarmonyOS 应用开发《掌上英语》第81篇: 智能体卡片:为英语学习 App 打造桌面级学习助手

AgentCard 智能体卡片:为英语学习 App 打造桌面级学习助手适用平台:HarmonyOS 7.0 (API 26 Beta)一、引言 HarmonyOS 7.0(API 26 Beta)新增了 AgentCard 智能体卡片能力,这是继 HMAF(鸿蒙智能体框架&#x…

2026/8/1 0:00:48 阅读更多 →