mycat查表报错Invalid DataSource:0解决方法

报错时机

  • 登录没问题
  • use库没问题
  • select任意一张表均报错

报错信息

mysql> select * from mydb.tb_user;
ERROR 3009 (HY000): java.lang.IllegalArgumentException: Invalid DataSource:0

解决方法

修改schema.xml
改为127.0.0.1,重启mycat

修改user表并不可行

网上有说修改user表,增加localhost(已存在%),尝试并不可行。

root用户
use mysql
select Host,User from user;
insert into user select 
'localhost',
 User                  ,
 Select_priv           ,
 Insert_priv           ,
 Update_priv           ,
 Delete_priv           ,
 Create_priv           ,
 Drop_priv             ,
 Reload_priv           ,
 Shutdown_priv         ,
 Process_priv          ,
 File_priv             ,
 Grant_priv            ,
 References_priv       ,
 Index_priv            ,
 Alter_priv            ,
 Show_db_priv          ,
 Super_priv            ,
 Create_tmp_table_priv ,
 Lock_tables_priv      ,
 Execute_priv          ,
 Repl_slave_priv       ,
 Repl_client_priv      ,
 Create_view_priv      ,
 Show_view_priv        ,
 Create_routine_priv   ,
 Alter_routine_priv    ,
 Create_user_priv      ,
 Event_priv            ,
 Trigger_priv          ,
 Create_tablespace_priv,
 ssl_type              ,
 ssl_cipher            ,
 x509_issuer           ,
 x509_subject          ,
 max_questions         ,
 max_updates           ,
 max_connections       ,
 max_user_connections  ,
 plugin                ,
 authentication_string ,
 password_expired      ,
 password_last_changed ,
 password_lifetime     ,
 account_locked        from user where user='myuser';

转载于:https://www.cnblogs.com/ouyida3/p/9031522.html

你可能感兴趣的:(mycat查表报错Invalid DataSource:0解决方法)