开发者社区> 问答> 正文

在mycat 环境下建立表后,在datanode中发现表名,字段名全为大写

在mycat 的环境下查看表名,是小写的。 但在具体datanode 环境下查看表名,字段名是大写 是什么原因导致影响的?怎样配置能达到一致是小写???

也没找到什么参数控制这个,但我在schema 中配置的表名是小写的, 只是schema 是大写。

参数如下:

schema.xml

    </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) );

展开
收起
1154228248247568 2021-04-21 11:52:45 974 0
0 条回答
写回答
取消 提交回答
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关实验场景

更多