导入数据时,由于 mysql 中的无效值 'testdatabase' 而忽略选项 '--databases' 收到警告
Getting warning ignoring option '--databases' due to invalid value 'testdatabase' in mysql while importing data
我在将 sql 数据导入 database.Its 时由于 mysql 中的无效值 'testdatabase' 而收到忽略选项 '--databases' 的警告,当我工作正常时在我的本地计算机上执行此操作,但通过 putty.I 已将文件复制到远程服务器上,但同样无法在远程服务器上运行。
这是我的查询
mysqldump -u root -p testdatabase < /home/user1/mydump.sql
远程机器(linux) mysql 版本:Ver 14.14 Distrib 5.6.14
本地机器(windows 7) mysql 版本:Ver 14.14 Distrib 5.6.21
Mysql 使用以下命令恢复:
mysql -u root -p testdatabase < /home/user1/mydump.sql
如果即使您尝试了@rups 解决方案也没有得到反映,那么您的计算机上的数据库名称可能不同。检查主机和远程机器中的数据库名称是否为 same.if 否 然后对数据库名称和 table 名称进行相关更改。
我从 mysqldump
收到了相同的错误消息,除了我的错误是由于 MySQL bug #41209.
如果你有一个看起来像这样的 ~/.my.cnf
[client]
database=d6
[mysqldump]
databases=false
而你 运行 mysqldump > dump.sql
,你会收到错误消息
mysqldump: ignoring option '--databases' due to an invalid value 'd6'
因为 mysqldump
实用程序读取配置文件的 [client]
部分,并且由于 MySQL CLI 程序执行选项解析的方式,--database
选项(被客户端识别,mysql
)被假定为完全不相关的--databases
选项(被mysqldump
识别)的缩写。
通常,mysqldump
的 --database
option for the client, mysql
, specifies the name of the database to operate on, while the --database<strong><em>s</em></strong>
option(注意末尾的 s
)是一个布尔开关,表示 "consider all 'name' arguments as databases to dump, rather than inferring the database name as being the first non-option argument on the command line, and the remaining 'names' as tables."
我在将 sql 数据导入 database.Its 时由于 mysql 中的无效值 'testdatabase' 而收到忽略选项 '--databases' 的警告,当我工作正常时在我的本地计算机上执行此操作,但通过 putty.I 已将文件复制到远程服务器上,但同样无法在远程服务器上运行。 这是我的查询
mysqldump -u root -p testdatabase < /home/user1/mydump.sql
远程机器(linux) mysql 版本:Ver 14.14 Distrib 5.6.14
本地机器(windows 7) mysql 版本:Ver 14.14 Distrib 5.6.21
Mysql 使用以下命令恢复:
mysql -u root -p testdatabase < /home/user1/mydump.sql
如果即使您尝试了@rups 解决方案也没有得到反映,那么您的计算机上的数据库名称可能不同。检查主机和远程机器中的数据库名称是否为 same.if 否 然后对数据库名称和 table 名称进行相关更改。
我从 mysqldump
收到了相同的错误消息,除了我的错误是由于 MySQL bug #41209.
如果你有一个看起来像这样的 ~/.my.cnf
[client]
database=d6
[mysqldump]
databases=false
而你 运行 mysqldump > dump.sql
,你会收到错误消息
mysqldump: ignoring option '--databases' due to an invalid value 'd6'
因为 mysqldump
实用程序读取配置文件的 [client]
部分,并且由于 MySQL CLI 程序执行选项解析的方式,--database
选项(被客户端识别,mysql
)被假定为完全不相关的--databases
选项(被mysqldump
识别)的缩写。
通常,mysqldump
的 --database
option for the client, mysql
, specifies the name of the database to operate on, while the --database<strong><em>s</em></strong>
option(注意末尾的 s
)是一个布尔开关,表示 "consider all 'name' arguments as databases to dump, rather than inferring the database name as being the first non-option argument on the command line, and the remaining 'names' as tables."