有人知道为什么我在运行mysqlimport时会出现这个错误吗?
mysqlimport -u someone -pwhatever --columns=a,b,c,d,e bar /var/tmp/baz.sql
mysqlimport: Error: 1045, Access denied for user 'someone'@'%' (using password: YES), when using table: baz然而..。
mysql -u someone -pwhatever
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 199
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show grants;
+------------------------------------------------------------------------------------------------------------+
| Grants for someone@% |
+------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'someone'@'%' IDENTIFIED BY PASSWORD '*BLAHBLAHBLAH' |
| GRANT ALL PRIVILEGES ON `bar`.* TO 'someone'@'%' |
+------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql>发布于 2011-07-27 06:45:30
好吧,事实证明FILE权限是一个“全局”权限,这显然意味着您不能有选择地在某些数据库、表上启用它。等等。这就是我之前在bar.*上的授权声明没有效果的原因:
GRANT ALL PRIVILEGES ON `bar`.* TO 'someone'@'%' 您需要在*.*上授予文件权限
GRANT FILE ON *.* to 'someone'@'%';希望这对某些人有帮助。
发布于 2012-02-26 21:03:54
您可以通过使用mysqlimport的--local参数来避免对额外权限的需要:
--local, -L
Read input files locally from the client host.发布于 2013-10-16 03:06:02
mysql -u username -p <yourdbname> < yourfile.sql
https://stackoverflow.com/questions/6837061
复制相似问题