2014-05-21 5 views
0
[[email protected] public_html]$ mysql dev_db; 
Reading table information for completion of table and column names 
You can turn off this feature to get a quicker startup with -A 

Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 860167 
Server version: 5.6.17-log MySQL Community Server (GPL) 

Copyright (c) 2000, 2014, 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> INSERT INTO `production_db.gg_weekly_report` (`submitted_by`, `report`) VALUES ('1541', 'test'); 
ERROR 1146 (42S02): Table 'dev_db.production_db.gg_weekly_report' doesn't exist 
mysql> 

Есть ли все-таки сделать это? И да, пользователь имеет доступ к обеим базам данных.Как вставить в таблицу другой базы данных в MySQL cli

ответ

2

Имя базы данных и имя таблицы индивидуальные идентификаторы, так что вам нужно, чтобы разграничить их по отдельности:

mysql> INSERT INTO `production_db`.`gg_weekly_report` ... 
Смежные вопросы