When you download SVOCat you get it preconfigured with the properties of an example catalogue.
The idea is that you can get, as fast as possible, a working version of SVOCat so that you can see it at work and get tips on how to configure your own catalogue.
This example catalogue is made using a very small subset of the SpeX Prism library. We have chosen it because it allows to explain many of the SVOCat options.
We have used the name excat2 (for 'example catalogue number 2') to label files, database tables and so on.
As a very brief summary:
In the data-csv/excat2.csv file you have the data in csv format.
These data are equivalent to a table with 10 rows and 10 columns.
Create a MySQL database (vocats)
We need to create a MySQL table with that structure and then load the data into it (you could want to take a look at the MySQL database configuration).
First, we need a database that you must create in your own way. A typical command to create a database is:
mysqladmin -u root -p create vocats
If you decide to use other name for the database, please go to the administration application and change it too in the Mysql section.
Create a MySQL user (mycatuser)
Creating a mysql user is a little more tricky. If you don't know how to do it you should probably ask for some help from your system administrator.
In any case, we give you a simplified example.
You first open the MySQL command line interface:
mysql -u root -p
Then, under the mysql prompt, you create a user named "mycatuser" with all privileges in the 'vocats' database and password "mycatp@ss"
mysql> grant all privileges on vocats.* to 'mycatuser'@'locahost' identified by 'mycatp@ss';
and you exit the mysql interface:
But take this as just a tip. You maybe want to be more restrictive about mycatuser permissions.
Create a MySQL table (excat2)
We now must create a table to contain the catalogue data. In the work/ folder you have a file work/create_table.my with the mysql instructions to create a table named "excat2".
you can use this file to create the table in the database as:
mysql -u mycatuser -p vocats < create_table.my
("mycatuser" must be a mysql-user allowed to create a table, like the one that we created above).
You can also create the table by your own means (using phpMyAdmin, by the command line mysql interface or by any other way that you are used to). Just use the same table definition shown above.
Load data into the table
The last step is loading the catalogue data into the table.
There are different methods that you could use to insert data into the database table.
(1) Using mysqlimport
An easy way is to use the command mysqlimport with the options already included in the file work/myimport.csh:
mysqlimport -u mycatuser -p --local --ignore-lines=1 --fields-terminated-by=, --columns=RAdeg,DECdeg,name,opspty,jmag,hmag,ksmag,dateobs,ref,filename0 --delete vocats excat2.csv
You can take a look to mysqlimport documentation (mysqlimport --help) to see more details or options. In this case:
(2) Inserting line by line (excat2.csv.my)
To do this you have work/excat2.csv.my which is a quite ugly file with instructions to load the data line by line:
You can use this script to load the data in the table as:
mysql -u mycatuser -p vocats < excat2.csv.my
If everything has gone right, you should have now a database table containing the catalogue data. You should be able to go to:
where, remember, http://www.mylab.org/catalogues/excat2/ should be the main URL that corresponds to your installation. (if you are trying to install this in a laptop or any other computer without a real internet address, try http://localhost/catalogues/excat2/)
And search for data in the "Data Retrieval" section.
The catalogue is small. To get a results try for instance: