gpt4 book ai didi

mysql - 在 Travis CI 中设置 lower_case_table_names

转载 作者:行者123 更新时间:2023-11-29 21:09:48 30 4
gpt4 key购买 nike

尝试在 MariaDB 中为 Travis-CI build设置小写表名称

addons:
mariadb: '10.1'

我已经尝试过

  - sudo sed -i '/\[mysqld\]/a lower_case_table_names = 2 ' /etc/mysql/my.cnf
- sudo service mysql restart

  -  echo "[mysqld]" > .my.cnf
- echo "lower_case_table_names = 2" >> .my.cnf

如果我运行:

  - mysql --verbose -e  "show variables like 'lower%';" --user=root

--------------
show variables like 'lower%'
--------------
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | OFF |
| lower_case_table_names | 0 |
+------------------------+-------+

这些是文件(在修改之前启动时运行)文件中没有一个包含 lower_case_table_names (除非我添加它)

#  - strace mysql 2>&1 | grep cnf
#stat("/etc/my.cnf", 0x7ffef7c8dca0) = -1 ENOENT (No such file or directory)
#stat("/etc/mysql/my.cnf", {st_mode=S_IFREG|0644, st_size=5232, ...}) = 0
#open("/etc/mysql/my.cnf", O_RDONLY|O_CLOEXEC) = 3
#stat("/etc/mysql/conf.d/mariadb.cnf", {st_mode=S_IFREG|0644, st_size=435, ...}) = 0
#open("/etc/mysql/conf.d/mariadb.cnf", O_RDONLY|O_CLOEXEC) = 4
#stat("/etc/mysql/conf.d/mysqld_safe_syslog.cnf", {st_mode=S_IFREG|0644, st_size=36, ...}) = 0
#open("/etc/mysql/conf.d/mysqld_safe_syslog.cnf", O_RDONLY|O_CLOEXEC) = 4
#stat("/etc/mysql/conf.d/tokudb.cnf", {st_mode=S_IFREG|0644, st_size=285, ...}) = 0
#open("/etc/mysql/conf.d/tokudb.cnf", O_RDONLY|O_CLOEXEC) = 4
#stat("/home/travis/.my.cnf", 0x7ffef7c8dca0) = -1 ENOENT (No such file or directory)

最佳答案

似乎某处出现了 doco 错误。这有效:

 -  echo "[mysqld]" > $HOME/.my.cnf
- echo "lower-case-table-names = 1" >> $HOME/.my.cnf

--------------
show variables like 'lower%'
--------------
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | OFF |
| lower_case_table_names | 1 |
+------------------------+-------+

关于mysql - 在 Travis CI 中设置 lower_case_table_names,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36482056/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com