在mycat 的环境下查看表名,是小写的。 但在具体datanode 环境下查看表名,字段名是大写 是什么原因导致影响的?怎样配置能达到一致是小写???
也没找到什么参数控制这个,但我在schema 中配置的表名是小写的, 只是schema 是大写。
参数如下:
</schema>
<dataNode name="dn1" dataHost="localhost1" database="db1" />
<dataNode name="dn2" dataHost="localhost2" database="db1" />
<dataNode name="dn3" dataHost="localhost3" database="db1" />
连接到mycat 中看到表名如下:
mysql> show tables; +------------------+ | Tables in ITCAST | +------------------+ | tb_account | | tb_user | +------------------+ 2 rows in set (0.00 sec)
但在各个具体datanode 库中看到: [root@mongo ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 52 Server version: 8.0.18 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; +--------------------+ | Database | +--------------------+ | db1 | | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.01 sec)
mysql> use db1; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed mysql> show tables; +---------------+ | Tables_in_db1 | +---------------+ | TB_ACCOUNT | | TB_USER | +---------------+ 2 rows in set (0.01 sec)
mysql> show create table TB_ACCOUNT; +------------+--------------------------------------+ | Table | Create Table | +------------+--------------------------------------------------------+ | TB_ACCOUNT | CREATE TABLE TB_ACCOUNT
( ID
int(11) unsigned NOT NULL, USER_ID
int(11) NOT NULL DEFAULT '0' COMMENT '用户ID', USER_NAME
varchar(30) NOT NULL DEFAULT '' COMMENT '用户名', ACCOUNT_ID
varchar(50) DEFAULT NULL COMMENT '银行电子账户/连连合作银行账户', PRIMARY KEY (ID
) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | +------------+------------------------------------------------------------------------+ 1 row in set (0.00 sec)
mysql> show create table tb_account ; ERROR 1146 (42S02): Table 'db1.tb_account' doesn't exist mysql>
mysql> SHOW VARIABLES LIKE '%case%' -> ; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | lower_case_file_system | OFF | | lower_case_table_names | 0 | +------------------------+-------+
-------------------------------建表 SQL ,是在mycat 环境执行SQL的 ------------------------
create table tb_user
( user_id
int(11) unsigned not null, user_name
varchar(30) not null default '' comment '用户名', mobile varchar(50) null default null , primary key (user_id) );
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。