Saturday, October 24, 2009

PsychoStats 3.1 Stats.pl not able to access the database remotely

As I have explained previously, if your Host is not allowing access to mysql remotely with SSH, dont worry. One way is to change the mysql host leaving the PHP host same. Find a mysql host who allows remote access.

If this sounds silly, just make your own server by installing Fedora Core 10 or 11 with all the packages for webserver including Perl and its ppms. Make your own PsychoStats installation. Now each time you update your local machine with stats, transfer the database to the webhost, who is not allowing the remote access.

This can be done like this,
  1. Give this command in local machine your Fedora - shell> mysqldump psychostats3_1 >newfile.txt
  2. You get a 2.8 MB txt file
  3. Log in into Hsoting Provider
  4. Go to Database PHPMyAdmin
  5. Go to restore or import
  6. give this file when asked
  7. All the tabels and data from your local web machine will go into the hosting provider mysql database
So now you can see the stats in the main website. But you need to do this everytime you update stats. If you are getting some problems like config changes in database like you theme directories change, you login information changes, then disable some tables from dumping. Like the command below
  • Shell> mysqldump psychostats --ignore-table=psychostats.ps_config --ignore-table=psychostats.ps_config_events --ignore-table=psychostats.ps_config_themes --ignore-table=psychostats.ps_errlogs --ignore-table=psychostats.ps_geoip_ip --ignore-table=psychostats.ps_geoip_cc
All the above command is a single command in single line. This will avoid this local machine config data to go in to the private hosting provider's database.

No comments:

Post a Comment