Sorry for a noob question regarding MySQL. I downloaded FlightStats to learn about mysql but I can’t figure out how to register it with my localhost mysql db. I know in MS SQL you can simply register any sql db using sql studio. I tried to google but come up with no result. Perhaps, my search phrase is wrong. I’m searching with “how to register a mysql database, register a mysql database…etc.”. How do you register or setup an database from existing database like FlightStats? I’m using DBVisualizer. Is there a way in dbVis that I’m not aware of to regsiter a database?
Thanks
edit: sorry for the bad wording. I found this. I have the .myd, .myi and .frm and I want to get it to restore(?) with my local mysql instance. I look at all the answers but I’m still confuse as how you restore the database from those 3 files.
A little background first. The FlightStats download page linked to in the original question appears to provide zipped tarballs of the binary table storage files from the MySQL data directory.
Given that this is considered a viable means of distribution, and combined with the use of MERGE tables, I would surmise that this tarball contains a bunch of MyISAM data files (Jack’s edit confirms that this is the situation..myi,.myd).This is an atypical means of distributing a MySQL data set, although not at all uncommon when backing up MyISAM storage, and probably not all that unheard of for moving large data sets around; it likely works out considerably more space-efficient than a corresponding dump file. Of course, in SQL Server land, it’s pretty common to attach database files into an instance.
Broadly speaking, you’d recover the database as follows:
/var/mysqlor similarflightdata.myi,.mydand other files from the tarball into this directorymysql) – usechmod -Rto make sure you get everythingUSE <database-name>SHOW TABLESYou should see some tables listed. In addition, the downloads page linked includes a couple of SQL scripts, which contain SQL commands that you need to run against your database once it’s in place. These will cause the merge definitions and table indexes to be rebuilt. You can pipe these into the command-line client, e.g.
mysql -u<username> -p<password> <database-name> < <sql-file>.It may be a good idea to shut down the MySQL server while you’re doing this; use e.g.
/etc/init.d/mysql stopor similar, and restart once the files are extracted in place.