How do I import data into SQL?

I have a list of books in an Excel spreadsheet (so I can export it as CSV etc.) and I would like to import them into a MySQL database.

In case it is important, the fields are:

Author, Title, Weight, Signed, Hardback, Condition, Genre

I am assuming that I will use terminal, type "mysql" and the go from there.

Can anyone help me? Do I have to create the table first and then load it in?

On my Windows machine I had a tool SQLite3.exe which was front end to MySQL. Is there anything like this for the Mac?

iMac 24 inch, 2.8 GHz, Mac OS X (10.6.6), 4 Gb RAM

Posted on Jan 30, 2011 3:51 PM

Reply
6 replies

Jan 30, 2011 4:56 PM in response to etresoft

I have several hundred book that I want to be able to show on my web page. These books are for sale.

I only mentioned SQLite3 because it is something that I have used and I just wanted to try an explain as best as I could, with what I know.

So, if you wanted to created and populate database with data (and you had a LOT of data (and it was in, say, CSV format) how would you create the database?

Jan 30, 2011 5:27 PM in response to pforkes

I'm not sure that I understand what you're asking or why you're posting here. It would seem that you're asking about how to create tables and insert data into a MySQL database, which isn't remotely an issue related to using Mac OS X. That's more of a question for an SQL forum. Besides which, if you're trying to create a web page that pulls data dynamically from an SQL database, you have a lot more work to do than just inserting the data. You probably need a book or two and a test server to do some experimenting with.

OTOH, if you're trying to figure out how to install and configure MySQL on your Mac, you can do it very easily with [MAMP|http://www.mamp.info>.

Jan 30, 2011 6:38 PM in response to pforkes

Well, as far as setting up and running a test server for learning or previewing sites, it just doesn't get easier than [MAMP|http://www.mamp.info>. Stick it in your Applications folder, run it and in seconds you've got an Apache server with PHP and MySQL running.

As to writing PHP code, managing MySQL databases, running queries, etc, that is all pretty much platform-independent, so any book, tutorial or whatnot will work. Extensive explanations on that sort of thing is outside the scope of these forums.

Jan 30, 2011 6:39 PM in response to pforkes

If you want to learn about PHP and MySQL, there are a number of books available that give far better walkthroughs and explanations than you could get in this kind of discussion forum. These two technologies are very rarely targeted to Windows so you should have no trouble finding a book that supports Mac users. This just isn't something that can be explained in this venue. If you start working on it and get stuck on one particular part, then we can help you get unstuck. But learning it has to be done on your own.

Also, if your goal is just to setup a website with your books, this is not the way to go about it. PayPal, eBay, Amazon, or a hosting provider like Dreamhost could get you setup with a web site and shopping card far more quickly than you could learn and implement the basics. Pretty much anyone who does this sort of thing themselves these days only does it because they want to and enjoy it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I import data into SQL?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.