2021-03-15T03:48:31.127387Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL. mysqld: File ‘./binlog.index‘ not found (OS errno 13 - Permission denied) 2021-03-15T03:49:07.154888Z 0 [Warning] [MY-010091] [Server] Can‘t create test file /data/mysql/mysqld_tmp_file_case_insensitive_test.lower-test 2021-03-15T03:49:07.154978Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 1580 2021-03-15T03:49:07.158908Z 0 [Warning] [MY-010091] [Server] Can‘t create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test 2021-03-15T03:49:07.158917Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive 2021-03-15T03:49:07.161942Z 0 [ERROR] [MY-010119] [Server] Aborting 2021-03-15T03:49:07.162165Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL.
解决办法
selinux,如果你恰好要操作的这台机器开着selinux,它确实能够使你的mysql无法在新目标位置进行mysql_install_db的操作,并爆出标题所示的警告。
一个简单的解决办法是使用命令暂时关闭selinux,以便让你的操作可以继续下去
setenforce 0
但最好使用一个永久方法,以便在重启后继续不要这货。
修改/etc/selinux/config文件中设置SELINUX=disabled ,然后重启或等待下次重启
Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test