Sunday, October 25, 2009

Speed up the Internet connection for Windows XP

1. From Windows XP, select Start->Run, enter regedit and click OK to start up Registry Editor.

2. At HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings, double click MaxConnectionsPer1_0Server to edit the value. Select Decimal, change it from default 10 to 100, then click OK to save it. Double click MaxConnectionsPerServer to edit the value. Select Decimal, change it from default 10 to 100, then click OK to save it.

Tuesday, October 20, 2009

Transfer MySQL database

One way to transfer database from one server to an other is to use dump file created by mysqldump. However, on the new server to restore the dump file, MySQL may complains this:

ERROR 1046 (3D000) at line xx: No database selected

To fix this problem, insert following 2 lines in bold before the "DROP TABLE IF EXISTS 'address'", in following example, of the dump file before restoring the database:

CREATE DATABASE databasename;
USE databasename


The modified dump file will create a new database and select it, then restore the dump file to this new database without problem.

The command syntax to backup/restore MySQL database as root are shown below:

Backup: mysqldump -u root -p databasename > dumpfilename

Restore: mysql -u root -p < dumpfilename

Note: the user has to enter the password for above commands.

Thursday, October 15, 2009

Install PHP plugin to Eclipse on CentOS 5.3

To install the the current PHP plugins to Eclipse, downlowd and unzip the file from to /usr/share/eclipse/plugins, then restart Eclipse.

Wednesday, October 14, 2009

Update to current PHP on CentOS 5.3

The default version of PHP installed on CentOS 5.3 is 5.1.6. The command "yum update php" won't update to the current version. The function filter_var() is unavailable at 5.1.6, so this causes the undefined function error. Following steps will update to the current version of PHP to fix this problem.

1. Run following to check the PHP version and it should be 5.1.6:

php -v

2. Create /etc/yum.repos.d/utterramblings.repo to contain following information:

name=Jason's Utter Ramblings Repo

3. Run following to update PHP as root:

yum update php

4. Run the following to confirm the update of PHP and currently it is 5.2.11:

php -v

5. Restart Apache server to pickup the new version of PHP.

/etc/init.d/httpd restart

6. The error "undefined function filter_var() ..." will be disappeared.