473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

load_file() problem

I'm running as mysql root user on my system.

I can select load_file('/etc/passwd'); no problem

But when I try to select load_file('/var/lib/mysql/mysql'); I get NULL as a result why? this file is good, I can cat it as root and view the mysql user data, why cant mysql load_file it? Its permissions are the default:

-rw-rw---- 1 mysql mysql 444 2009-08-04 19:08 user.MYD

It's owner is by default the user mysql and has read permission, so why doesn't mysql like to load_file it? Is mysql somehow blocking access to this file and if so how can I bypass that? Doing stuff like mysql/../mysql in the path doesn't work, and using hex encoding didn't work either?
Nov 29 '09 #1
2 9981
Atli
5,058 Expert 4TB
Hey.

You say you are trying to load a file called "/var/lib/mysql/mysql" but your ls output lists a file named "user.MYD". Could you simply have typed in the wrong path?

If not, consider this, from the manual:
The file must be readable by all and its size less than max_allowed_packet bytes.
It says "readable by all". Perhaps you need to CHMOD the file to 664? (Or otherwise readable by everybody.)

The max_allowed_packet directive could of course also be messing with your code. Worth checking.
Nov 30 '09 #2
You need to grant the MySQL FILE privilege to the user. Note that this is a GLOBAL permission. It allows the user to access all files that MySQL has permissions to.

You can set it with the command:

GRANT FILE ON *.* TO person@'<host>';
Apr 5 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mike w. | last post by:
I have the following code in my asp project. In Test.lpk i added MS Common Dialoag but i always get an error "Object required: "Common Dialog1" so CommonDialog1 isn't being created. What am i...
0
by: nouno | last post by:
I am trying to spell check a richtextbox. Through code (shown below) I save the contents of the richtextbox to a rtf file, open the rtf file in Word, spell check it, save it, and then load the ftf...
3
by: Mike Krueger | last post by:
Hi I'm currently working on a forms designer for a free .NET IDE (SharpDevelop -> www.icsharpcode.net/OpenSource/SD). problem: I try to put 'custom' components (user controls from the current...
1
by: Sacha | last post by:
If I use Assembly.LoadFile("name.dll") and then I want to create instace of class inside the assembly using reflection Type.GetType("class.name") doesn't work unless I do Assembly asm =...
2
by: Bonzo | last post by:
Hi, How do I simply open a text file into a textbox? I know that in C++ I'd use something like: if(OpenDialog1->Execute()) Memo1->Lines->LoadFromFile(OpenDialog1->FileName); How can I do it...
0
by: Christian Stapfer | last post by:
Hi, I get the following traceback when trying to have wx.lib.pdfwin.PDFWindow open a PDF file: E:\Tutoring\Teacher\Flashcards>python pdfwin1.py Traceback (most recent call last): File...
2
by: Peted | last post by:
can anyone help me with the following bellow is a routine i use that works, that will load an assembly from a dll class from the HDD, and instantiate a form to be used to control a device. ...
1
by: Peted | last post by:
Hello bellow is select sample of code im using to dynamicaly load assembley's and it works, but the assembley.loadfile requires that i use a absolute directory path. Is there anyway i can use...
0
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
Working in Visual Studio 2005 and C#, I have an application that has an exe and several dll files in the bin\debug directory. The code in question looks something like this: string...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.