Sonny Gauran
|
Posted: October 04, 2009 03:57 by Sonny Gauran
|
Requirements:
Table of Contents:
Contents: Where to Get: MySQL Connector J: The MySQL Connector can be found at the MySQL Downloads or with a Google Search. The World Database: The World Database is available at the MySQL Doc Site or with a Google Search. When you download the world database however, it requires you to copy-paste the unpacked files to the data directory of a MySQL Server. I have included the World database in sql format as world.sql in our sandbox repository at /exercises/MySQL for easy import. ICI-CECSD Team SQLs: All SQL Files developed by the team are available at the svn repository at /project/team/sql/. This contains the earlier sandbox.sql and the worldline.sql. How to Use: Importing SQL Files: In this example, we are going to import the world.sql via the command-line.
Take note: **You need to have MySQL installed** Let's first create a database in the unit you are working on. C:\Documents and Settings\desktopUsername\Desktop>mysql -u root -p This will change your terminal from dos to mysql prompt: mysql>create database worldline; mysql>exit; After that, you can easily import your sql into worldline by: C:\Documents and Settings\desktopUsername\Desktop\icj~s\exercises\MySQL>mysql -u mysqlUsername -p db_name < world.sql After running this command, mysql will prompt for a password and then afterwards import the sql to the specified database. You can follow the same format for the team's sql. In this example, we have the command-line located inside the working copy's project\team\MySQL directory. C:\Documents and Settings\desktopUsername\Desktop\icj~s\project\team\MySQL>mysql -u mysqlUsername -p worldline < worldline.sql Exporting SQL Files: For versioned SQL Files, just dump your SQL files appropriately inside the project\team\MySQL directory by following the command: C:\Documents and Settings\desktopUsername\Desktop\icj~s\project\team\MySQL>mysqldump -u mysqlUsername -p worldline > worldline.sql This will dump the contents of the worldline database inside worldline.sql. To version the database sql just commit the contents of project\team\MySQL inside your working copy. C:\Documents and Settings\desktopUsername\Desktop\icj~s\project\team\MySQL>svn commit -m "[I]" --username kenaiUsername --password kenaiPassword If you added a new sql file inside your \project\team\MySQL working copy, most-likely it will not be versioned. So just add the file in your working copy for versioning and then commit: C:\Documents and Settings\desktopUsername\Desktop\icj~s\project\team\MySQL>svn add yourDb.sql C:\Documents and Settings\desktopUsername\Desktop\icj~s\project\team\MySQL>svn commit -m "New file yourDB.sql added containing the database yourDB" --username kenaiUsername --password kenaiPassword |
Working with SQL Files and your Kenai Project
Replies: 0 - Last Post: October 04, 2009 03:57
by: Sonny Gauran
by: Sonny Gauran
showing 1 - 1 of 1
Replies: 0 - Last Post: October 04, 2009 03:57
by: Sonny Gauran
by: Sonny Gauran






