我有一个数据库mydb
。你可以在这里看到它:
SHOW DATABASES
'information_schema'
'ebdb'
'mysql'
'performance_schema'
'tmp'
'mydb'
我可以从中选择明确:
SELECT *
FROM mydb.mytable
但是,我不能将它用作我的默认架构。
USE mydb
Error Code: 1049. Unknown database 'mydb'
为用户拨款:
SHOW GRANTS for 'username'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'username'@'%' IDENTIFIED BY PASSWORD 'password' WITH GRANT OPTION
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER ON `%`.* TO 'username'@'%'
为什么use命令不能与mydb一起使用?