AlmaLinux9怎么安装MySQL 8.0.32

1、配置安装源

# 安装dnf install http://mirrors.ustc.edu.cn/mysql-repo/mysql80-community-release-el9.rpm -y # 修改配置sed -i 's@http://repo.mysql.com/@http://mirrors.ustc.edu.cn/mysql-repo/@g' /etc/yum.repos.d/mysql-community*.repo

2、安装MySQL

dnf install -y mysql-community-server

3、配置MySQL

if [ ! "$(cat /usr/bin/mysqld_pre_systemd | grep -v ^\# | grep initialize-insecure )" ]; then    sed -i "s@--initialize @--initialize-insecure @g" /usr/bin/mysqld_pre_systemdfi

4、修改配置文件

[client]port = 3306socket = /var/lib/mysql/mysql.sockdefault-character-set = utf8mb4 [mysql]prompt="MySQL [\d]> "no-auto-rehash [mysqld]port = 3306socket = /var/lib/mysql/mysql.sockdefault_authentication_plugin = mysql_native_password datadir = /var/lib/mysqlpid-file = /var/lib/mysql/mysql.piduser = mysqlbind-address = 0.0.0.0server-id = 1 init-connect = 'SET NAMES utf8mb4'character-set-server = utf8mb4collation-server = utf8mb4_0900_ai_ci skip-name-resolve#skip-networkingback_log = 300 max_connections = 5295max_connect_errors = 6000open_files_limit = 65535table_open_cache = 1024max_allowed_packet = 500Mbinlog_cache_size = 1Mmax_heap_table_size = 8Mtmp_table_size = 128M read_buffer_size = 2Mread_rnd_buffer_size = 8Msort_buffer_size = 8Mjoin_buffer_size = 8Mkey_buffer_size = 256M thread_cache_size = 64 ft_min_word_len = 4 log_bin = mysql-binbinlog_format = rowbinlog_expire_logs_seconds = 604800 log_error = /var/lib/mysql/mysql-error.logslow_query_log = 1long_query_time = 1slow_query_log_file = /var/lib/mysql/mysql-slow.log performance_schema = 0explicit_defaults_for_timestamp lower_case_table_names = 1 skip-external-locking default_storage_engine = InnoDB#default-storage-engine = MyISAMinnodb_file_per_table = 1innodb_open_files = 500innodb_buffer_pool_size = 1024Minnodb_write_io_threads = 4innodb_read_io_threads = 4innodb_thread_concurrency = 0innodb_purge_threads = 1innodb_flush_log_at_trx_commit = 2innodb_log_buffer_size = 2Minnodb_log_file_size = 32Minnodb_log_files_in_group = 3innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 120 bulk_insert_buffer_size = 8Mmyisam_sort_buffer_size = 64Mmyisam_max_sort_file_size = 10G interactive_timeout = 28800wait_timeout = 28800 binlog_rows_query_log_events = 1log_bin_trust_function_creators = 1log_timestamps = SYSTEM sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION#sql_mode = NO_AUTO_VALUE_ON_ZEROinnodb_strict_mode = 0plugin-load=mysql_clone.so [mysqldump]quickmax_allowed_packet = 500M [myisamchk]key_buffer_size = 256Msort_buffer_size = 8Mread_buffer = 4Mwrite_buffer = 4M

5、启动MySQL

systemctl enable --now mysqld

6、安全配置

# mysql_secure_installationmysql_secure_installation: [ERROR] unknown variable 'default-character-set=utf8mb4'.Securing the MySQL server deployment.Connecting to MySQL using a blank password.The 'validate_password' component is installed on the server.The subsequent steps will run with the existing configurationof the component.Please set the password for root here.New password:     #输入密码Re-enter new password:      #输入密码Estimated strength of the password: 100Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : yBy default, a MySQL installation has an anonymous user,allowing anyone to log into MySQL without having to havea user account created for them. This is intended only fortesting, and to make the installation go a bit smoother.You should remove them before moving into a productionenvironment.Remove anonymous users? (Press y|Y for Yes, any other key for No) : ySuccess.Normally, root should only be allowed to connect from'localhost'. This ensures that someone cannot guess atthe root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : ySuccess.By default, MySQL comes with a database named 'test' thatanyone can access. This is also intended only for testing,and should be removed before moving into a productionenvironment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database...Success. - Removing privileges on test database...Success.Reloading the privilege tables will ensure that all changesmade so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : ySuccess.All done!

以上就是AlmaLinux9怎么安装MySQL 8.0.32的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/149088.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年12月2日 23:40:05
下一篇 2025年12月2日 23:40:26

相关推荐

  • win10关闭自动更新 四种禁止更新方法分享

    windows 10系统内置了自动更新机制,虽然有助于保持系统安全与稳定,但对不少用户来说,频繁的更新提示、计划外的重启甚至强制重启严重影响了使用体验。尤其是在进行重要工作或沉浸式游戏时,突如其来的系统更新极易打断操作流程。那么,如何有效关闭win10的自动更新呢?本文将介绍四种实用、安全且可逆的方…

    2025年12月5日 电脑教程
    600
  • HiDream-I1— 智象未来开源的文生图模型

    hidream-i1:一款强大的开源图像生成模型 HiDream-I1是由HiDream.ai团队开发的17亿参数开源图像生成模型,采用MIT许可证,在图像质量和对提示词的理解方面表现卓越。它支持多种风格,包括写实、卡通和艺术风格,广泛应用于艺术创作、商业设计、科研教育以及娱乐媒体等领域。 HiDr…

    2025年12月5日
    000
  • MySQL ERROR 1045出现的原因及怎么解决

    在命令行输入mysql -u root –p,输入密码,或通过工具连接数据库时,经常出现下面的错误信息,相信该错误信息很多人在使用mysql时都遇到过。 ERROR 1045 (28000): Access denied for user ‘root’@’loca…

    2025年12月5日 数据库
    000
  • 如何在Laravel中集成支付网关

    在laravel中集成支付网关的核心步骤包括:1.根据业务需求选择合适的支付网关,如stripe、paypal或支付宝等;2.通过composer安装对应的sdk或laravel包,如stripe/stripe-php或yansongda/pay;3.在.env文件和config/services.…

    2025年12月5日
    300
  • linux上安装docker容器和mysql镜像拉取的方法

    docker pull xxxx 拉取镜像 docker run -it xxxx /bin/bash 启动镜像 启动docker服务 docker ps 查询运行中的容器 docker ps -a 查询所有容器,包括未运行的 mysql容器启动:docker run -itd –nam…

    数据库 2025年12月5日
    000
  • js如何实现剪贴板历史 js剪贴板历史管理的4种技术方案

    要实现js剪贴板历史,核心在于拦截复制事件、存储复制内容并展示历史记录。1. 使用document.addeventlistener(‘copy’)监听复制事件,并通过e.clipboarddata.getdata获取内容;2. 用localstorage或indexeddb…

    2025年12月5日 web前端
    100
  • 如何在Laravel中实现缓存机制

    laravel的缓存机制用于提升应用性能,通过存储耗时操作结果避免重复计算。1. 配置缓存驱动:在.env文件中设置cache_driver,如redis,并安装相应扩展;2. 使用cache facade进行缓存操作,包括put、get、has、forget等方法;3. 使用remember和pu…

    2025年12月5日
    000
  • Java中Executors类的用途 掌握线程池工厂的创建方法

    如何使用executors创建线程池?1.使用newfixedthreadpool(int nthreads)创建固定大小的线程池;2.使用newcachedthreadpool()创建可缓存线程池;3.使用newsinglethreadexecutor()创建单线程线程池;4.使用newsched…

    2025年12月5日 java
    000
  • ubuntu下mysql 8.0.28怎么安装配置

    修改密码改了挺长时间,记录下安装过程 安装ssh服务: sudo apt-get install openssh-server 启动ssh服务: service sshd start 安装mysql服务器端: sudo apt install -y mysql-server 安装mysql客户端: …

    2025年12月5日
    000
  • linux运维之ftp服务器功能介绍

    ftp作为最古老的协议之一,目前还没广泛使用者,它主要用作服务器与客户机之间文件的传输。ftp协议是使用明文传输协议的,所有具有一定的安全隐患。linux系统上有一个vsftpd软件,这个软件虽然功能不多,但重点是比较安全,建议大家使用该软件来作为ftp文件传输服务器。除此之外,用的也比较多的是pu…

    运维 2025年12月5日
    100
  • js如何解析XML格式数据 处理XML数据的4种常用方法!

    在javascript中解析xml数据主要有四种方式:原生domparser、xmlhttprequest、第三方库(如jquery)以及fetch api配合domparser。使用domparser时,创建实例并调用parsefromstring方法解析xml字符串,返回document对象以便…

    2025年12月5日 web前端
    100
  • 解决WordPress博客首页无法显示页面标题的问题

    摘要:本文针对WordPress主题开发中,使用静态页面作为博客首页时,home.php无法正确显示页面标题的问题,提供了详细的解决方案。通过使用get_the_title()函数并结合get_option(‘page_for_posts’)获取文章页面的ID,从而正确显示博…

    2025年12月5日
    000
  • 如何在Laravel中处理表单提交

    在laravel中处理表单提交的步骤如下:1. 创建包含正确method、action属性和@csrf指令的html表单;2. 在routes/web.php或routes/api.php中定义路由,如route::post(‘/your-route’, ‘you…

    2025年12月5日
    100
  • WordPress博客首页无法显示页面标题的解决方案

    本教程旨在解决WordPress主题开发中,使用静态首页和博客页面展示最新文章时,home.php无法正确获取页面标题和特色图像的问题。通过使用get_the_title()函数并结合get_option(‘page_for_posts’)获取博客页面的ID,可以确保博客首页…

    2025年12月5日
    000
  • MySQL事件调度器如何使用_能实现哪些自动化任务?

    mysql事件调度器是内置的定时任务工具,用于自动化周期性操作。一、开启方法:用show variables查看event_scheduler状态,若为off则在配置文件添加event_scheduler=on或临时执行set global开启;二、创建语法:create event定义触发时间、频…

    2025年12月5日 数据库
    000
  • mysql临键锁如何使用

    1、默认情况下,innodb使用临键锁锁定记录。 select … for update 2、当查询索引包含唯一属性时,临键锁将被优化并降级为记录锁,即只锁定索引本身,而不是范围。 3、不同场景下的临键锁会退化。 实例 事务1 start transaction;select SLEEP(4);…

    数据库 2025年12月5日
    000
  • 126邮箱官网登录入口网页版 126邮箱登录首页官网

    126邮箱官网登录入口网页版为https://mail.126.com,用户可通过邮箱账号或手机号快速注册登录,支持密码找回、扫码验证;页面适配多设备,具备分栏式收件箱、邮件筛选、批量操作及星标分类功能;附件上传下载支持实时进度与断点续传,兼容多种文件格式预览。 126邮箱官网登录入口网页版在哪里?…

    2025年12月5日
    100
  • 曝小米已终止澎湃OS 2全部开发工作!聚焦澎湃OS 3

    CNMO从海外媒体获悉,小米已全面停止对澎湃OS 2的所有开发进程,集中力量推进下一代操作系统——澎湃OS 3的开发与发布准备。 据最新消息,澎湃OS 3有望于今年8月或9月正式亮相。初步资料显示,新系统将重点提升用户界面的精致度、系统动画的流畅性以及整体运行性能。小米方面强调,将确保现有设备用户能…

    2025年12月5日
    000
  • js怎样实现粒子动画效果 炫酷粒子动画的3种实现方式

    实现炫酷的粒子动画可通过以下三种方式:1. 使用 canvas 实现基础 2d 粒子动画,通过创建 canvas 元素、定义粒子类、使用 requestanimationframe 创建动画循环来不断更新和绘制粒子;2. 使用 three.js 实现 3d 粒子动画,借助 webgl 渲染器、场景、…

    2025年12月5日 web前端
    000
  • MySQL命令行中如何修改MySQL密码

    方法一: mysql admin -u 用户名 -p 旧密码 passw 新密码 ‘u’为 username 的简称,‘p’为原 password 简称。 方法二: 我们先登录 MySQL 数据库。之后输入: mysql>set password for root@localhost = pa…

    数据库 2025年12月5日
    000

发表回复

登录后才能评论
关注微信