Server SQL upload

From StatsLab Wiki
Revision as of 13:08, 18 June 2013 by Frank Esselink (talk | contribs) (Created page with "Using the StatsLab admin page to load the SQL files into MySQL can sometimes cause problems with web hosts that restrict the amount of time scripts can run or the amount of me...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Using the StatsLab admin page to load the SQL files into MySQL can sometimes cause problems with web hosts that restrict the amount of time scripts can run or the amount of memory available to them. If you are able to load SQL files individually from the SQL File Load page, but not as a group using the Load SQL Files button on the Admin Page, you might consider using the server SQL upload script.

These instructions assume that you have StatsLab installed and functional with access to your database.

Configuring the Server SQL Upload

The StatsLab zip file contains a file called server_db_update.php.sample.


Configuration steps:

  1. Duplicate server_db_update.php.sample
  2. Rename the duplicate to "server_db_update.php"
  3. Edit server_db_update.php
    1. Change the adminpath to the same path defined in config.txt
    2. Validate that the league id ($lgid) is correct for your league. Usually, this is the default of 100.
  4. Upload server_db_update.php to your server and put it in your normal StatsLab directory.

Running the Server SQL Upload

To run the server SQL upload, you will need shell access to your webserver and permission to run PHP scripts.

  1. Log onto your web server
  2. Navigate to your StatsLab directory
  3. Enter the following command: "php server_db_update.php"

You should see the script begin to run, with text output as each SQL file is loaded into your database.