在配置文件中添加lower_case_table_names = 2后启动mysql 8.0 fai

时间:2019-02-22 08:59:37

标签: mysql

我已将mysql服务器(版本:8.0)安装到Linux服务器中。

MySQL数据库在Linux环境中区分大小写。

我在[mysqld]下添加了“ lower_case_table_names = 2”,并使用systemctl restart mysqld.service重新启动服务器,但是Mysql无法启动

这是我的my.cnf配置

[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. It's default setting is log_bin=binlog
# 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
lower_case_table_names=1
bind-address=192.168.1.25
# 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-plugin=mysql_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

这是日志文件/var/log/mysqld.log

2019-02-22T08:50:44.849482Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.15) starting as process 6819
2019-02-22T08:50:45.112952Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('0').

我该如何解决这个问题

谢谢

1 个答案:

答案 0 :(得分:0)

Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive. This works only on file systems that are not case-sensitive! InnoDB table names and view names are stored in lowercase, as for lower_case_table_names=1.

请注意第二句话,因为您将其从1切换为2。。您在Linux上,因此区分大小写,这仅适用于Windows,不适用于您的情况。另外,如果将其放在Windows上,则必须备份,转换表并以小写形式查看名称。

更多内容,请点击此处https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html