R编程语言
这是我的疑问:
LOAD DATA LOCAL INFILE '/home/ap_506/KF/export_2015-07-20.csv'
INTO TABLE test.raporty
FIELDS TERMINATED BY ';'
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES;
我将local-infile=1
放入档案:/etc/mysql/my.cnf
:
[mysql]
local-infile=1
[mysqld]
local-infile=1
仍然会返回错误:
Error Code: 1148. The used command is not allowed with this MySQL version
版本:
SELECT VERSION()
返回:'5.5.40-0ubuntu0.12.04.1'
它可以工作,我可以通过终端上传:
mysql -h <server> -u <user> -p --local-infile <database>
我也可以从WINDOWS上传
但这不是灵魂,因为我需要使用ubuntu并从R上传数据。你能帮助我吗?
答案 0 :(得分:0)
我找到了部分解决方案。我添加了describe('myAppCtrl', function() {
var scope, controller, httpBackend;
beforeEach(module('myApp'));
beforeEach(inject(function($rootScope, $controller, $httpBackend) {
scope = $rootScope;
controller = $controller;
httpBackend = $httpBackend;
}));
it('should populate the reddit data when the HTTP request succeeds', function() {
httpBackend.when('GET','https://www.reddit.com/r/worldnews/new.json').respond({names});
controller('myAppCtrl', {'$scope': scope });
httpBackend.flush();
scope.$apply();
expect(scope.names.children.length).toEqual(25);
});
it('should show the number of items in list',function() {
var data = $('#title');
expect(data).toBeTruthy();
//expect(1).toBe(1);
});
});
2行:
/etc/mysql/my.cnf
我可以通过R中的RODBC使用查询[odbc]
local-infile=1
,但Workbench仍存在同样的问题:LOAD DATA LOCAL INFILE
有什么想法吗?如何查看Workbench正在使用的驱动程序?