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:50:40阅读更多 →
7.9英寸触摸屏在树莓派、Jetson Nano与Windows上的驱动配置与进阶应用

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

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

2026/8/1 19:50:40阅读更多 →
彻底告别拖延症: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 integrations for Jir…

2026/8/1 19:48:40阅读更多 →
MyBatis 配置一篇详解

MyBatis 配置一篇详解

本文详细讲解MyBatis 的配置文件&#xff08;通常是 mybatis-config.xml&#xff09;是核心配置入口&#xff0c;用于全局配置数据库连接、插件、映射器等。以下是主要配置项及其用法&#xff1a; 1. 配置文件结构概览 <?xml version"1.0" encoding"UTF-8&q…

2026/8/1 21:13:09阅读更多 →
2026六盘水黄金回收白银回收铂金回收市民首选无隐形扣费正规备案回收门店联系方式推荐

2026六盘水黄金回收白银回收铂金回收市民首选无隐形扣费正规备案回收门店联系方式推荐

2026六盘水黄金白银铂金回收实测榜单&#xff5c;公安工商双备案无损测金无折旧费门店 在六盘水&#xff0c;贵金属回收店铺遍地丛生&#xff0c;行业套路层出不穷&#xff0c;不少市民变现遭遇虚高报价、克扣损耗、未经同意熔金压价等问题。为帮助本地居民规避消费陷阱&#x…

2026/8/1 21:13:09阅读更多 →
2025年最新 默语佬 简介:默语佬 是谁?

2025年最新 默语佬 简介:默语佬 是谁?

2025年最新 默语佬 简介 &#x1f464; 关于默语佬 默语佬&#xff0c;本名闫文超&#xff0c;是一位融合“技术实力内容影响力”的科技创作者。默语佬不仅是一名AI全栈开发工程师&#xff0c;更是拥有20万全网粉丝的知名科技自媒体博主。 他还是&#xff1a; CSDN COC 北京城市…

2026/8/1 21:13:09阅读更多 →
如何高效管理游戏存档:Unreal Engine存档编辑终极解决方案

如何高效管理游戏存档:Unreal Engine存档编辑终极解决方案

如何高效管理游戏存档&#xff1a;Unreal Engine存档编辑终极解决方案 【免费下载链接】uesave Rust library and CLI to read and write Unreal Engine save files 项目地址: https://gitcode.com/gh_mirrors/ue/uesave 还在为游戏存档损坏而烦恼&#xff1f;珍贵的游戏…

2026/8/1 21:13:09阅读更多 →
本来想Trae创造参赛获得的Fast Pass干别的活

本来想Trae创造参赛获得的Fast Pass干别的活

本来想Trae创造参赛获得的Fast Pass干别的活&#xff0c;没想到Trae 跟印度有一拼&#xff0c;直接改底层规则&#xff0c;Fast Pass取消、Credit制度上线&#xff0c;之前的免费赠送的额度折扣可谓“脚踝斩”。 不过用人家的手软、吃人家的嘴硬、蹭人家的无感。所以&#xff0…

2026/8/1 21:13:09阅读更多 →
One-Core-API:为Windows XP/2003注入现代应用生命力的终极兼容层解决方案

One-Core-API:为Windows XP/2003注入现代应用生命力的终极兼容层解决方案

One-Core-API&#xff1a;为Windows XP/2003注入现代应用生命力的终极兼容层解决方案 【免费下载链接】One-Core-Api-Source A complete layer to get compatibility on XP/2003 for newer applications 项目地址: https://gitcode.com/gh_mirrors/on/One-Core-Api-Source …

2026/8/1 21:11:09阅读更多 →
覆盖国产 + 海外 + 开源模型,OpenClaw 2.7.9 Windows/Mac 双端部署详解

覆盖国产 + 海外 + 开源模型,OpenClaw 2.7.9 Windows/Mac 双端部署详解

&#x1f539; 工具基础介绍 OpenClaw 是开源生态中一款实用性较强的本地智能工具&#xff0c;凭借本地离线运行、可视化图形操作和任务自动化三大核心特性&#xff0c;赢得了众多用户的青睐。与普通在线对话AI工具不同&#xff0c;它属于能够直接操控本机软硬件的智能数字员工…

2026/7/31 20:44:05阅读更多 →
伺服阀焊完微漏毁整机?精密激光焊接三关锁住高压

伺服阀焊完微漏毁整机?精密激光焊接三关锁住高压

所谓液压伺服阀体的精密激光焊接&#xff0c;是用激光束对阀座壳体&#xff08;通常为不锈钢或铝合金&#xff09;进行密封焊接&#xff0c;使阀体在21-35MPa的高压液压油或压缩气体中长期运行而不发生介质泄漏。液压伺服阀是高端液压系统的"大脑"。从航空航天飞行控…

2026/7/31 17:41:43阅读更多 →
D2DX:三步实现《暗黑破坏神2》高清宽屏体验的终极指南

D2DX:三步实现《暗黑破坏神2》高清宽屏体验的终极指南

D2DX&#xff1a;三步实现《暗黑破坏神2》高清宽屏体验的终极指南 【免费下载链接】d2dx D2DX is a complete solution to make Diablo II run well on modern PCs, with high fps and better resolutions. 项目地址: https://gitcode.com/gh_mirrors/d2/d2dx 你是否还在…

2026/8/1 21:14:15阅读更多 →
无损视频剪辑终极指南:如何实现快速高效的多媒体处理

无损视频剪辑终极指南:如何实现快速高效的多媒体处理

无损视频剪辑终极指南&#xff1a;如何实现快速高效的多媒体处理 【免费下载链接】lossless-cut The swiss army knife of lossless video/audio editing 项目地址: https://gitcode.com/gh_mirrors/lo/lossless-cut 在数字媒体创作领域&#xff0c;视频编辑处理的质量损…

2026/8/1 0:00:10阅读更多 →
AI辅助本科论文写作:8大工具评测与高效使用指南

AI辅助本科论文写作:8大工具评测与高效使用指南

1. 本科生论文写作的AI辅助现状本科毕业论文是每个大学生必须跨越的一道坎。记得我当年写论文时&#xff0c;光是文献检索就花了整整两周时间&#xff0c;打印的参考文献堆满了半个书桌。如今AI技术的发展为学术写作带来了革命性变化&#xff0c;合理使用这些工具可以节省80%以…

2026/8/1 0:00:10阅读更多 →
如何快速配置大麦自动抢票系统:从零开始搭建Python抢票助手

如何快速配置大麦自动抢票系统:从零开始搭建Python抢票助手

如何快速配置大麦自动抢票系统&#xff1a;从零开始搭建Python抢票助手 【免费下载链接】ticket-purchase 大麦自动抢票&#xff0c;支持人员、城市、日期场次、价格选择 项目地址: https://gitcode.com/GitHub_Trending/ti/ticket-purchase 还在为抢不到热门演唱会门票…

2026/8/1 0:00:10阅读更多 →
无损视频剪辑终极指南:如何实现快速高效的多媒体处理

无损视频剪辑终极指南:如何实现快速高效的多媒体处理

无损视频剪辑终极指南&#xff1a;如何实现快速高效的多媒体处理 【免费下载链接】lossless-cut The swiss army knife of lossless video/audio editing 项目地址: https://gitcode.com/gh_mirrors/lo/lossless-cut 在数字媒体创作领域&#xff0c;视频编辑处理的质量损…

2026/8/1 0:00:10阅读更多 →
AI辅助本科论文写作:8大工具评测与高效使用指南

AI辅助本科论文写作:8大工具评测与高效使用指南

1. 本科生论文写作的AI辅助现状本科毕业论文是每个大学生必须跨越的一道坎。记得我当年写论文时&#xff0c;光是文献检索就花了整整两周时间&#xff0c;打印的参考文献堆满了半个书桌。如今AI技术的发展为学术写作带来了革命性变化&#xff0c;合理使用这些工具可以节省80%以…

2026/8/1 0:00:10阅读更多 →
如何快速配置大麦自动抢票系统:从零开始搭建Python抢票助手

如何快速配置大麦自动抢票系统:从零开始搭建Python抢票助手

如何快速配置大麦自动抢票系统&#xff1a;从零开始搭建Python抢票助手 【免费下载链接】ticket-purchase 大麦自动抢票&#xff0c;支持人员、城市、日期场次、价格选择 项目地址: https://gitcode.com/GitHub_Trending/ti/ticket-purchase 还在为抢不到热门演唱会门票…

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