問題如標題:
使用Mycat 連接到mySQL8 建立表,發現表名,欄位名全為大寫
在mycat 的環境下查看表名,是小寫的。但在具體datanode 環境下查看表名,欄位名是大寫
是什么原因導致影響的?怎樣配置能達到一致是小寫???
也沒找到什么引數控制這個,但我在schema 中配置的表名是小寫的,
只是schema 是大寫。
引數如下:
schema.xml
------------------------------------------------------------------------------------------------------------------
<schema name="ITCAST" checkSQLschema="true" sqlMaxLimit="100">
<!-- auto sharding by id (long) -->
<table name="tb_account" dataNode="dn1,dn2,dn3" rule="auto-sharding-long" />
<table name="tb_user" dataNode="dn1,dn2,dn3" rule="auto-sharding-long" />
</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)
);
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/278629.html
標籤:MySQL
上一篇:pb9怎么生成二維碼
