next up previous contents
Next: Start cataloging stuff Up: Installing phpMyCatalog Previous: Settings   Contents

Initialize the database

Migration from 0.2.0 to 0.3.0 note: If you have been using 0.2.0 and you don't want to initialize your database (i.e. loose all your catalogs). You have to do the following:
  1. Edit the 0.2-to-0.3.sql file and change USE phpMyCatalog; --> USE yourdatabase; (if it was not called phpMyCatalog) Note that if you didn't change the name of your databese in config.inc during the installation of 0.2.0 it IS named phpMyCatalog and you don't have to edit the file.
  2. Execute from the shell (from your phpMyCatalog installation directory) the following command:

    mysql --verbose --host=localhost --user=root -p < 0.2-to-0.3.sql

    Note that you should change the host name and user name if they aren't localhost and root. You will be prompted for a password, press ENTER if you don't have a password.

    If you plan to initializate your database follow the following steps:

    1. Ponit your browser to http://[your_host]/[phpMyCatalog_location]/index.php and then click on the Initialize DB link and follow the instructions. If you can see that link in the phpMyCatalog main index you should check previous steps.

      For example, if you install the software in /var/www/html/phpMyCatalog-0.x.x, your Apache "document root" is /var/www/html/ (very common) and you host is localhost, The program can be started by pointing your browser to (see figure 1):

      http://localhost/phpMyCatalog-0.x.x/

      or

      http://localhost/phpMyCatalog-0.x.x/index.php

      (then bookmark that location, it's much more confortable)

      Figure 1: Main menu.
      Image main_menu

    2. If the process fails, you should check permissions on the phpMyCatalog installation directory and the permissions of the MySQL user specified in config.inc to drop/create databases and tables item You can follow the "Initialize DB" link whenever you want to delete all tha information in the database
    3. There is almost no error handling in database initialization. You can check if it has been succesfull typing in the shell (in red is what you type) :

      $ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 3.23.52

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

          mysql> show databases;
          +--------------+
          | Database     |
          +--------------+
          | mysql        |
          | phpMyCatalog |
          +--------------+
          2 rows in set (0.00 sec)
          mysql> quit
      

      You should see your phpMyCatalog database there (in my case it's phpMyCatalog). If you cannot see it, there has been an error in your database initialization, posibly related to mysql user access rights. As you should have seen, the "automatic" database initialization process shows you the command that it's trying to run. If you get errors creating the database, you should attempt to run the command manually from the shell (from phpMyCatalog directory). You my have to change host and user data if they are not localhost/root.

      mysql -verbose -host=localhost -user=root -p < initialize.sql

      If you can't get the thing running, please post a support request on sourceforge project page by clicking here.


next up previous contents
Next: Start cataloging stuff Up: Installing phpMyCatalog Previous: Settings   Contents
Jorge Nadal 2003-06-07