Mycat 基础7

2021-12-03 20:34:41 浏览数 (1)

这是由于没指定数据源产生的报错

虽然没有连接任何数据库,但从操作体验上来看,与直接操作一个mysql没有什么区别

Tip: 为什么用户名和密码是 test 呢,因为 conf/server.xml 有定义

代码语言:javascript复制
<user name="test">
	<property name="password">test</property>
	<property name="schemas">TESTDB</property>
</user>
<user name="user">
	<property name="password">user</property>
	<property name="schemas">TESTDB</property>
	<property name="readOnly">true</property>
</user>

所以user/user也可以登录

代码语言:javascript复制
[root@h101 ~]# mysql -uuser -puser  -P8066 -h 192.168.100.102
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.5.8-mycat-1.5-GA-20160217103036 MyCat Server (OpenCloundDB)

Copyright (c) 2000, 2015, 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 |
 ---------- 
| TESTDB   |
 ---------- 
1 row in set (0.00 sec)

mysql> use TESTDB;
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 TESTDB |
 ------------------ 
| company          |
| customer         |
| customer_addr    |
| employee         |
| goods            |
| hotnews          |
| orders           |
| order_items      |
| travelrecord     |
 ------------------ 
9 rows in set (0.00 sec)

mysql> desc hotnews;
ERROR 1495 (HY000): User readonly
mysql> desc commpany;
ERROR 1495 (HY000): User readonly
mysql> desc customer;
ERROR 1495 (HY000): User readonly
mysql> 

0 人点赞