Import CSV to existing MySQL table using PhpMyAdmin

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay we have a excel file it looks like this it has of the current elected officials in it fully and we are going to import them into this table here electives and this table has got 95 represent it it's got all of Oahu and the offices let me just quick see what the offices are select distinct office from electeds and we see we have u.s. senator Iowa City Council we do not have any of the neighbor island offices so that's exactly what we're going to be importing so that would be these down here starting with Kauai and Maui and the Big Island so first we will to be safe we shall make a copy of this let's do operations and we're going to copy it copy table to temp and you copy it over and we see now that we've been a electeds temp so let's go to like this temp and it's the same table and we're going to import we're going to import let's prepare the file for import this this is the file we are going to we don't need these records down to here delete these delete and this blank record this point record and let's see we can also delete the blank rows to this row that's not blank this is blank these three are blank these two are blank County Council's are nonpartisan employee so that's why you don't see a party and don't need it so these are all gone let's see what else no we can simply save this save as and let's save it on our desktop and let's call it electeds to import that's a good name save it as a dot CSV click Save and yes that's fine and we see here's our here's our saved file and so we need to modify this a little bit let's open this with notepad so I think I need to close this first of the close this okay now let's open this with notepad and we see here's our file nice pick up the word wrap see they're nice records here and let's go back to our import so let's it turns out that we don't want the the column heading so let's we're going to import a CSV it's going to be comma separated we're not going to replace it that's fine we need some column names so to do that let's look again at our notepad look at that we want these here these are our column names so let's copy that we can cut it actually cut it and paste that here and then we want to get rid of that get rid of the column headings let's save this again and it's called electeds to import and so now we can go up here and select that file we want to go to the desktop and you can find electeds to import and we see it here and these are all set up so let's click go and we see it produce 25 queries follow these imports and now when we browse we see that there's 120 records and at the end here we can see that we've got our new records and that's it
Info
Channel: Richard Halverson
Views: 149,571
Rating: undefined out of 5
Keywords: MySQL (Software), PhpMyAdmin (Software), Comma-Separated Values (File Format)
Id: xppyP5ibbYM
Channel Id: undefined
Length: 5min 28sec (328 seconds)
Published: Wed Dec 31 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.