码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • centos 7.5 安装mysql 5.7.32 中自定义data的目录


    一  话补多少,上代码

    这里存储mysql的数据目录设定为:/dky-mysql-data/data   确保这个全路径为mysql:mysql的用户和用户组。

    1.执行完初始化后:没有信息输出

    [root@localhost bin]# ./mysqld --initialize --user=mysql --basedir=/usr/local/mysql-5.7.32 --datadir=/dky-mysql-data/data
    [root@localhost bin]# 

    2.这里需要进入配置的log日志中查看

    [root@localhost bin]# cd ..
    [root@localhost mysql-5.7.32]# ls
    bin  docs  include  lib  LICENSE  logs  man  mysqlid.id  README  share  support-files
    [root@localhost mysql-5.7.32]# cd logs
    [root@localhost logs]# ls
    mysql-log.err

    [root@localhost logs]# more mysql-log.err 
    2022-08-17T16:20:09.194488Z 0 [Warning] InnoDB: New log files created, LSN=45790
    2022-08-17T16:20:09.321040Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
    2022-08-17T16:20:09.385549Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 768e167d-1e
    48-11ed-8034-000c29e6d1f9.
    2022-08-17T16:20:09.387375Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
    2022-08-17T16:20:10.276995Z 0 [Warning] CA certificate ca.pem is self signed.
    2022-08-17T16:20:10.617879Z 1 [Note] A temporary password is generated for root@localhost: lJr?4lm!0;xs

    标记为红色的部分,为系统设置的初始密码。

    3.启动mysql服务,如下:
    [root@localhost logs]# service mysql start
    Starting MySQL. SUCCESS! 

    [root@localhost logs]# ps -ef|grep mysql
    root       3781      1  0 00:22 pts/0    00:00:00 /bin/sh /usr/local/mysql-5.7.32/bin/mysqld_safe --datadir=/dky-mysql-data/data --pid-file=/usr/local/mysql-5.7.32/mysqlpid.pid
    mysql      3981   3781 10 00:22 pts/0    00:00:00 /usr/local/mysql-5.7.32/bin/mysqld --basedir=/usr/local/mysql-5.7.32 --datadir=/dky-mysql-data/data --plugin-dir=/usr/local/mysql-5.7.32/lib/plugin --user=mysql --log-error=/usr/local/mysql-5.7.32/logs/mysql-log.err --pid-file=/usr/local/mysql-5.7.32/mysqlpid.pid --port=3306
    root       4017   2620  0 00:22 pts/0    00:00:00 grep --color=auto mysql
     

  • 相关阅读:
    数据库系统原理与应用教程(082)—— MySQL 系统数据库分析 —— information_schema
    甲方需求被公司明确指示不能做,身为公司项目经理,怎么处理?
    仅 7 人的公司,年收 100 万美元!但从谷歌辞职的老板决定:以 60 万美元,卖掉...
    肠道微生物群与过敏性鼻炎
    视频监控管理平台EasyCVR自动注销后,页面还存留播放窗口是什么原因?解决办法是什么?
    K8s-Traefik Ingress Controller
    web前端-css中最直观的反馈-伪类及伪元素选择器的使用
    Java图片或视频生成GIF动图,发送微信
    “人间烟火”背后,长沙招商引资再出圈
    python 小案例76
  • 原文地址:https://blog.csdn.net/u011066470/article/details/126377030
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号