nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

loading data with INFILE

This is a discussion on loading data with INFILE within the Databases servers forums, part of the Mastering Servers category; Hi all, I am having trouble loading data directly into my database. I have copied the file onto the remote ...


Go Back   nixCraft Linux Forum > Mastering Servers > Databases servers

Linux answers from nixCraft.


Databases servers Discussions of databases of all types - especially MySQL.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 23-10-2008, 03:19 PM
DragonMaster's Avatar
Junior Member
User
 
Join Date: Oct 2008
OS: Debian, Ubuntu Kubuntu
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
DragonMaster is on a distinguished road
Default loading data with INFILE

Hi all,

I am having trouble loading data directly into my database. I have copied the file onto the remote server, but whenever I run the command :
Code:
 mysql -h host -u user -p -D test -e "load data infile '/tmp/CHANGE_Raw_Data.txt' replace into table changeTable fields terminated by '|'"
I get
Code:
ERROR 1045 (00000) at line 1: Access denied for user: 'user@host' (Using password: YES)
I know that I can use the LOCAL keyword, but as the file in question is 260Mb, the command locks the table for over an hour while an internal ftp is carried out - hence I want to be able to do a manual ftp, followed by a 14sec database update. Any suggestions?

BTW, due to IT issues, I am still running MySQL v3.23 and can't upgrade yet...
Reply With Quote
  #2 (permalink)  
Old 24-10-2008, 08:46 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Try login using ssh:
Code:
ssh user@server-ip
mysql -u user -p dbnane < INFILE
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 05-11-2008, 02:13 PM
DragonMaster's Avatar
Junior Member
User
 
Join Date: Oct 2008
OS: Debian, Ubuntu Kubuntu
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
DragonMaster is on a distinguished road
Default

Thanks for the reply nixcraft, I have had a look at this, but isn't this the method for re-building a database or table from a mysqldump? The problem I still face, is that the data to be loaded is a 'pipe' separated text file, and won't load with this method...
Reply With Quote
Reply

Tags
mysql , mysql load files , sql database


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How loading Modules at boot time muralidhara.rk CentOS / RHEL / Fedora 3 08-09-2009 02:37 PM
Linux XP not loading / booting Computer newtolinux Ubuntu / Debian 1 11-06-2008 10:05 PM
Problem loading Atheros AR5005G in Ubuntu, Kubutu, & PCLinuxOS blackrosebud Linux hardware 0 02-10-2007 11:10 PM
squid service error loading on startup asim.mcp Linux software 5 27-07-2006 02:29 PM
print data to txt rock Shell scripting 1 10-03-2006 02:01 AM


All times are GMT +5.5. The time now is 11:26 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38