Linux环境下部署MySQL8数据库
MySQL安装1、下载软件包mysql-8.0.15-1.el7.x86_64.rpm-bundle.tar2、将软件包通过moba上传到linux系统/usr/local/soft/目录下3、解压软件包cd /usr/local/soft/ tar -xvf mysql-8.0.15-1.el7.x86_64.rpm-bundle.tar4、卸载系统自带mariadbrpm -qa | grep mariadb yum -y remove mariadb-libs-5.5.52-1.el7.x86_645、下载依赖包可直接全部复制粘贴批量执行yum -y install openssl-devel perl-JSON yum install -y libaio.x86_64 libaio-devel.x86_64 yum install -y openssl-devel.x86_64 openssl.x86_64 yum install -y perl.x86_64 perl-devel.x86_64 yum install -y perl-JSON.noarch yum install -y autoconf yum install net-tools –y yum -y install numactl6、顺序安装mysql可直接全部复制粘贴批量执行rpm -ivh mysql-community-common-8.0.15-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-8.0.15-1.el7.x86_64.rpm rpm -ivh mysql-community-client-8.0.15-1.el7.x86_64.rpm rpm -ivh mysql-community-server-8.0.15-1.el7.x86_64.rpm rpm -ivh mysql-community-devel-8.0.15-1.el7.x86_64.rpm安装完默认是mysql用户、用户组和权限chown -R mysql:mysql /var/lib/mysql/7、重启mysql服务systemctl restart mysqld.service systemctl status mysqld.service若启动失败查看tail -n 100 /var/log/mysqld.log8、查看密码cat /var/log/mysqld.log | grep password或cd /var/log/ cat mysqld.log9、数据库登陆mysql -u root -p输入第八步中的密码进行登陆10、设置登陆密码复杂度set global validate_password.length4; set global validate_password.policy0;11、修改密码ALTER USER rootlocalhost IDENTIFIED BY root123; flush privileges;12、开放所有IP都能访问use mysql; select host, user, authentication_string, plugin from user; CREATE USER root% IDENTIFIED BY root123; grant all privileges ON *.* to root% with grant option; flush privileges;13、修改加密方式ALTER USER root% IDENTIFIED WITH mysql_native_password BY root123; select host, user, authentication_string, plugin from user;14、重启数据库quit systemctl restart mysqld.service或systemctl start mysqld设置开机自启动systemctl enable mysqld.service15、远程navicat连接测试16、其它配置初始状态# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/8.0/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.0/en/server-system-variables.html#sysvar_default_authentication_plugin # default-authentication-pluginmysql_native_password datadir/var/lib/mysql socket/var/lib/mysql/mysql.sock log-error/var/log/mysqld.log pid-file/var/run/mysqld/mysqld.pid其它配置参考如下vi /etc/my.cnf# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld] port3323 #skip-grant-tables # # 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 leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # 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 datadir/var/lib/mysql socket/var/lib/mysql/mysql.sock log-error/var/log/mysqld.log pid-file/var/run/mysqld/mysqld.pid # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links0 lower_case_table_names1 sql_modeSTRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION max_allowed_packet 500M wait_timeout86400重置密码ALTER USER rootlocalhost IDENTIFIED BY asdfadfbEVG; ALTER USER root% IDENTIFIED BY asdfadfbEVG; flush privileges;FAQ1、错误依赖检测失败libcrypto.so.10()(64bit) 被 mysql-community-libs-8.0.15-1.el7.x86_64 需要遇到类似的错误的话可以试试在rpm安装命令后添加--nodeps --force如rpm -ivh mysql-community-common-8.0.15-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-libs-8.0.15-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-client-8.0.15-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-server-8.0.15-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-devel-8.0.15-1.el7.x86_64.rpm --nodeps --force2、云服务器上数据库总是恢复可在配置文件中添加innodb_force_recovery 13、让表忽略大小写由于8.0没法设置参数后重启失败所以必须删掉老库重新启动才行。切记本步骤要删掉老库所有资料如果是数据库当前有用请做好备份再进行操作。systemctl stop mysqld #默认数据在这里 cd /var/lib/mysql rm -rf *编辑配置文件vim /etc/my.cnf配置文件中添加symbolic-links0 lower_case_table_names1 sql_modeSTRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION max_allowed_packet 500M wait_timeout86400重启数据库systemctl restart mysqld此时由于重新初始化数据库老密码已经没有了系统自动初始化一个随机新密码sudo grep temporary password /var/log/mysqld.log还有一种就是最新版的MYSQL8 默认root没密码 直接mysql进去重复上面10-13步骤然后验证配置结果show variables like %case_table%;重新远程连接如下参考地址Mysql8忽略大小写的解决方案.240105 - 中国的Amadeus - 博客园

相关新闻

Golang语言入门

Golang语言入门

Golang语言入门一、Go语言是什么二、优点三、环境安装四、配置环境变量五、开发环境一、Go语言是什么 Go语言完整称呼是golang语言,是由 Google 在2009年发布的一种静态强类型、编译型、并发型编程语言,它结合了 C 语言的高性能和Python/JavaScript 的开…

2026/11/10 18:35:55 阅读更多 →
《妃梦千年》第12章-永巷的毒

《妃梦千年》第12章-永巷的毒

第12章 永巷的毒 从城南回宫,林清婉做的第一件事,是去永巷。 废妃暴毙,内侍省按规矩要呈验尸文书。她如今是贤妃,掌福宁、永宁二殿事,看一眼永巷的卷宗,没人拦得住。 卷宗摊在桌上,仵作的字歪歪…

2026/10/24 13:50:43 阅读更多 →
VS Code 骨架屏(Skeleton Screen)深度解析与实战-Day28

VS Code 骨架屏(Skeleton Screen)深度解析与实战-Day28

关键词:VS Code, 骨架屏, Skeleton Screen, 感知性能, Electron, 启动优化, 扩展开发 一、引言:骨架屏的价值与边界 骨架屏(Skeleton Screen)是一种在数据加载完成前展示页面大致结构的 UI 技术,通过灰色占位块和微光…

2026/11/8 19:37:39 阅读更多 →

最新新闻

Electron桌面应用开发实战:从环境搭建到打包发布全流程

Electron桌面应用开发实战:从环境搭建到打包发布全流程

做前端这些年,我大部分时间都在跟浏览器标签页打交道,直到第一次把桌面应用跑起来,才发现原来自己一直被限制在地址栏和刷新按钮围起来的框框里。Electron这个词,最开始是在某段时间频繁出现在同事的讨论里,一个用HTML…

2026/11/20 23:27:28 阅读更多 →
滑盖智能锁T109深度解析:结构原理、安装调试与故障排查

滑盖智能锁T109深度解析:结构原理、安装调试与故障排查

简介:亚太天能T109滑盖智能锁产品说明书是一份PDF格式的官方技术文档,主要面向智能锁安装人员、终端用户及售后维护者,帮助快速掌握产品安装、配置与常见故障处理。全包仅1个PDF文件,大小4.37MB,内容结构清晰&#xff…

2026/11/20 23:27:28 阅读更多 →
PMSM弱磁控制原理与Simulink建模:高速AGV驱动系统设计指南

PMSM弱磁控制原理与Simulink建模:高速AGV驱动系统设计指南

上个月我在调试一台高速AGV的驱动系统,整车要求空载跑到8m/s,电机转速已经拉到额定点,驱动器的输出电压也顶到了母线电压极限附近。再往上踩速度指令,转速纹丝不动,三相电流反而开始震荡。那会儿我的第一反应就是&…

2026/11/20 23:27:28 阅读更多 →
C++核心知识点:从内存管理到STL的实战指南

C++核心知识点:从内存管理到STL的实战指南

C 这门语言我前前后后折腾了十几年,用它写过嵌入式驱动、做过游戏服务端,也搭过基础组件库。每次看到新人一头扎进"C 核心知识点"这个搜索词,我其实挺感慨的——这门语言的难点从来不是语法多,而是知识点之间的耦合太深…

2026/11/20 21:55:32 阅读更多 →
T109滑盖智能锁怎么装?安装调试与故障排查全攻略

T109滑盖智能锁怎么装?安装调试与故障排查全攻略

简介:亚太天能T109滑盖智能锁产品说明书以PDF格式发布,适合智能锁用户、安装人员与售后维修人员阅读。内容围绕T109系列指纹密码刷卡锁展开,先介绍前面板、后面板、锁体、机械钥匙、电池盒盖等部件名称与功能,再给出完整安装步骤&…

2026/11/20 23:27:28 阅读更多 →
LLM知识降熵:从信息垄断到理解权下放

LLM知识降熵:从信息垄断到理解权下放

你有没有过这种经历:翻开源码注释、论文摘要或者一份专业报告,每个字都认识,连在一起却像天书。想找人聊聊,身边要么没人懂,要么懂的懒得跟你解释。后来我试着把同一段内容丢给一个大语言模型,几秒钟之后&a…

2026/11/20 22:59:12 阅读更多 →

日新闻

周新闻

月新闻