大家好,我想请教个问题。我想查询mysql数据库中表的个数。不知道该怎么写语句。
我只知道oracle中是select count(*) from user_tables;
但是不知道mysql中怎么写。
另外,我想查询出有哪些表。oracle中是用select table_name from user_tables;
但是我在mysql中用select table_name from user_tables这条语句,就报如下错误。
Base table or view not found message from server: "Table 'bly.user_tables' doesn't exist"
java.sql.SQLException: Base table or view not found message from server: "Table 'bly.user_tables' doesn't exist"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2001)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1168)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1279)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1225)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2278)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2225)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1163)
at jdbcmysql.T_mysqltablejg.main(T_mysqltablejg.java:29)
--转自