• 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
     

  • 相关阅读:
    LVGL---windows PC模拟器(codeblocks)运行LVGL
    10-134 4-6 查询在具有最小内存容量的所有PC中具有最快处理器的PC制造商
    6月26日第壹简报,星期日,农历五月廿八
    【SQL Server + MySQL三】数据库设计【ER模型+UML模型+范式】 + 数据库安全性
    【LeetCode刷题日志】160.相交链表
    leetcode 51. N皇后 回溯法求解(c++版本)
    GNSS模块如何应用在“监控案例”中
    C多线程编程- 近似求解π
    rm The parameter list is too long argument list too long
    Python练手算法
  • 原文地址:https://blog.csdn.net/u011066470/article/details/126377030