建议你列出你的表结构,并提供测试数据以及基于这些测试数据的所对应正确结果。猜不出你的表结构,一般来说select 'table1' as tname from table1 where uid=1 union all select 'table2' as tname from table2 where uid=1 ... union all select 'tableN' as tname from tableN where uid=1
“所以想到查询所有含有admin值的表看看是否还需要修改哪里。 ”------------------------------------- 这个不能一个语句搞定的, 也比较复杂,得自己写个存储过程来循环实现吧: select * from information_schema.tables where table_schema='库名' select * from information_schema.columns只能利用动态语句对上面2个系统表来实现对不同表的所有列进行一次全扫描去查找了
union all
select 'table2' as tname from table2 where uid=1
...
union all
select 'tableN' as tname from tableN where uid=1
不知道为什么admin这个用户进不去了,
改了cdc_members跟cdc_uc_members这2个表里的admin的密码也进不了
所以想到查询所有含有admin值的表看看是否还需要修改哪里。
表的数量很多,而且名字无规则,只能一个一个地关联起来查询么?
不能用到*来代表所有表吗?
这个不能一个语句搞定的, 也比较复杂,得自己写个存储过程来循环实现吧:
select * from information_schema.tables where table_schema='库名'
select * from information_schema.columns只能利用动态语句对上面2个系统表来实现对不同表的所有列进行一次全扫描去查找了