Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何插入另一个数据库';MySQL cli中的s表_Mysql_Sql - Fatal编程技术网

如何插入另一个数据库';MySQL cli中的s表

如何插入另一个数据库';MySQL cli中的s表,mysql,sql,Mysql,Sql,有什么办法可以这样做吗?是的,用户可以访问这两个数据库。数据库名和表名是单独的标识符,因此需要分别对它们进行分隔: [dev@server 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

有什么办法可以这样做吗?是的,用户可以访问这两个数据库。

数据库名和表名是单独的标识符,因此需要分别对它们进行分隔:

[dev@server 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> INSERT INTO `production_db`.`gg_weekly_report` ...