In my hosting account I have set up a database named george. There is one table named "news". There are three fields "id" (primary key), "date", and "text". I am keeping this simple for illustration. What is the best/easiest/fastest way to import the data or records to the table via mysqladmin import text file??? Thanks
printman55 0 Light Poster
Recommended Answers
Jump to PostIt depends on your source. Importing an SQL file is probably the fastest as it requires no parsing. You can also import from CSV. If your source is a table, you can just copy it in with a query (provided you can connect to both).
Jump to PostReally, even though sql file is ready to go and the csv has to parsed and validated ? Impressive if that is true. Do you have any resources on this ?
Jump to PostWhat data ? A CSV file ?
Jump to PostThe code from the mysql prompt goes like
load data infile "george.csv" into table george fields terminated by "\t";
See http://dev.mysql.com/doc/refman/5.1/en/load-data.html
@priteas: No, I only remember dimly to have …
Jump to PostUse MySQL's DATE_FORMAT() function. The query will be
SELECT DATE_FORMAT(news_date, '%M %e, %Y') FROM table;
All 25 Replies
pritaeas 2,211 ¯\_(ツ)_/¯ Moderator Featured Poster
smantscheff 265 Veteran Poster
pritaeas 2,211 ¯\_(ツ)_/¯ Moderator Featured Poster
printman55 0 Light Poster
pritaeas 2,211 ¯\_(ツ)_/¯ Moderator Featured Poster
printman55 0 Light Poster
smantscheff 265 Veteran Poster
printman55 0 Light Poster
smantscheff 265 Veteran Poster
printman55 0 Light Poster
smantscheff 265 Veteran Poster
printman55 0 Light Poster
smantscheff 265 Veteran Poster
printman55 0 Light Poster
smantscheff 265 Veteran Poster
printman55 0 Light Poster
smantscheff 265 Veteran Poster
printman55 0 Light Poster
smantscheff 265 Veteran Poster
printman55 0 Light Poster
drjohn 56 Posting Pro in Training
printman55 0 Light Poster
mwasif 10 Posting Whiz
printman55 0 Light Poster
smantscheff 265 Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.