HTML/JavaScript

Tuesday, July 29, 2014

Import large .sql file into MySQL

C:\> mysql -hlocalhost -uroot -proot

mysql> SHOW VARIABLES LIKE 'wait_timeout';

If this is very low (e.g. 30 seconds) then increase it (e.g. 5 minutes):

mysql> SET SESSION wait_timeout = 300;
mysql> SET SESSION interactive_timeout = 300;

Then execute your SQL file (issue a USE `db` if necessary):
mysql> use TUTORIALS;

mysql> \. database.sql

Friday, July 25, 2014

“The service is unavailable.” Magento admin links

Issue was with some kind of Zend cache! I simply went to magento/lib/Zend/Cache/Backend/File.php and changed the

'cache_dir' => null,

to

'cache_dir' => 'tmp/',

Before doing it, I created folder named tmp under root of my website given IUSR writing permission.

Tuesday, July 8, 2014

Upgrading Magento Via SSH

Once you've accessed your site via SSH, change in to the directory where Magento is installed and run the following commands to upgrade Magento (you should make a backup of your files and database before proceeding):

chmod +x mage
./mage mage-setup .
./mage config-set preferred_state stable
./mage sync
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
php shell/indexer.php reindexall
rm -rf downloader/.cache/ var/cache/


For Magento 1.4.x and earlier, please use the following commands:
chmod +x pear
./pear upgrade-all
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* var/cache/

If you receive an error, that means the PEAR registry has not been initialized. You need to run the following commands:

chmod 550 pear
./pear mage-setup .
./pear install magento-core/Mage_All_Latest
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* var/cache/