- Security. No. More. Privacy. No. More. The PlayStation Breach: Why You Should Remain Calm – NYTimes.com http://nyti.ms/m5GFZa #
Month: April 2011
Mosfilm Gold Collection on YouTube
Excellent news for all the fans of old Soviet movies: Mosfilm, one of the biggest movie studios in Russia, created a partner channel on YouTube. Â They will upload a lot of the classics in full length, good quality, and with English subtitles. Â Approximately 20 movies are already uploaded, and Mosfilm has promised to upload at least 5 full featured films every week. Â By their own calculations, there will be more than 200 movies on that channel by the end of the 2011. Â And all that content absolutely free!
MySQL export CSV into OUTFILE triggers “access denied” error
I came across a weird problem today. Â Gladly, the web is full of solutions, but I’m going to post this anyway, just to have it nearby for the next time. Â I needed to export the results of some query into a CSV file directly from MySQL. Â I prepared my query, made sure that I can see the correct results and than changed it to export into the file. The query looked something like this:
SELECT id, field1, field2, field3 INTO OUTFILE '/tmp/data.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM data_table WHERE field1 = 0;
I was quite surprised to find myself staring at:
ERROR 1045 (28000): Access denied for user ‘db_user’@’localhost’ (using password: YES)
My database user definitely had full access to the database. Â I definitely could see the results of the query before the redirect to the file. Â And I definitely had enough permissions to create files in /tmp directory. Â And on top of that, I’m sure I used MySQL export functionality a gadzillion times and it always worked without any problems. Â What’s wrong this time?
A quick search around got me to this Stack Overflow question. Â Apparently, database user has to be given a FILEÂ privilege, which is global (not per-database). Â Here is what I did to solve the problem (you’ll need to use MySQL root user of course):
USE mysql; UPDATE user SET File_priv = 'Y' WHERE User = 'db_user'; FLUSH PRIVILEGES;
I think that it worked for me before was because I exported as root, who does have this permission set to ‘Y’.
Day in brief
- Shared: Weblog Tools Collection: Do you Make a Living with WordPress? http://bit.ly/grehsJ #
Day in brief
- I'm at Carrefour http://4sq.com/gtSlat #
- Here is something from my Happy Easter collection: Salmonella – Wikipedia, the free encyclopedia http://bit.ly/e0G0Fn #
- Shared: Long label names in Gmail http://bit.ly/ieXs6M #
- I'm at Chester's http://4sq.com/eQ1mhl #