09. IT
FireFox에서 sqlite export 할 수 있는 add-in
오뉴
2013. 10. 29. 13:45
http://otland.net/threads/convert-sqlite-to-mysql-database-with-pictures.47742/
Well to start this off I'll just say that I was trying to import my sqlite database into a MySQL database and had no idea. Well after many hours, sweat & tears etc... I've come up with an answer! 
1. Download Firefox if you don't have it; Firefox Browser | Free ways to customize your Internet
![[IMG]](http://i25.tinypic.com/jv0ht5.jpg)
2. Download this sql2mysql converter addon; https://addons.mozilla.org/en-US/firefox/addon/5817
![[IMG]](http://i32.tinypic.com/2qaigd2.jpg)
3. When it's done installing, restart firefox, then go to Tools, "SQLite Manager"
![[IMG]](http://i30.tinypic.com/26449c8.jpg)
4. The program will open up, you should click on the "Connect Database" icon (looks like a folder).
![[IMG]](http://i31.tinypic.com/2m5i539.jpg)
5. Select and find your previous SQLite database (make sure you enable "all files" searching!)
![[IMG]](http://i26.tinypic.com/6q8wn5.jpg)
6. Go to "File", "Database" and select "Export Database" and save it in the same location, but with a ".sql" filetype.
7. Now I suggest downloading "Notepad++" (found here; Notepad++ ) to edit your server, but "Notepad" works fine as well.
8. Open your .sql server file that you just exported in notepad, notepad++ or whatever other text editor you have and use the "Find & Replace" feature (default hotkey is CTRL + H)
9. Now find all DoubleQuotes (") and replace them with backticks (`) and click Replace All, then save it.
![[IMG]](http://i28.tinypic.com/f4pxyf.jpg)
10. Open your mysql.sql example MySQL Database (by default located in the "schemas" folder) with your text editor, and "File" --> "Save As" --> "mysqlCopy.sql" in the same place. Don't close it!
![[IMG]](http://i28.tinypic.com/f4pxyf.jpg)
Now, here comes the tricky part, this is very important to understand!
Each chunk of data is called an SQL Query, that is a command that your SQL server will execute when the file is imported. It starts with an action verb (eg. CREATE, DROP, INSERT) and ends with a semicolon (
.
11. After each SQL Query that creates a table (seen below), you must copy over your INSERT Queries from your SQL database into your MySQL database that insert things (just look at the pics if you don't understand).
![[IMG]](http://i28.tinypic.com/520t2s.jpg)
12. Make sure you paste all the INSERT queries after each CREATE TABLE query!
![[IMG]](http://i31.tinypic.com/15pk9c1.jpg)
![[IMG]](http://i32.tinypic.com/fbfd6w.jpg)
13. You can copy & paste as many INSERT queries as you wish, but I would suggest at least copying over all of the;
- accounts
- houses
- players
- player_depotitems
- player_items
- player_skills
- player_storage
- tiles
- tile_items
14. In the CREATE TABLE Query which creates "player_items", reverse cid & pid since MySQL & SQLite stores them differently.
![[IMG]](http://i29.tinypic.com/t018hi.jpg)
![[IMG]](http://i32.tinypic.com/10qcry9.jpg)
15. Go to http://localhost/phpmyadmin/ and import your mysqlCopy.sql file like you would the normal mysql.sql file if you were starting brand new.
16. Host your server!