CountryWhois® DB
This page list explains how to use the CountryWhois database on your Web server. As a database source, you can utilize the database in MySQL format or use a simple binary file. You can use either PHP or Perl as a programming language.
Using the Database in MySQL Format
- Download the MySQL dump (available in the member area).
- Import the dump into your MySQL database. There are two ways to do this:
- Using SSH/Telnet: You need SSH or Telnet access to your site (check with your hosting company to see if this is available) and an SSH/Telnet Client, such as PuTTY. Open your SSH/Telnet client and log into your Web site. The command line prompt you will see will vary by OS. For most hosting companies, this will bring you into the FTP root folder. Type in the following:
mysql -u dbusername -p databasename < /path/to/cwhois.sql
You will be prompted for the database password. Enter it and the database will import. If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The command line will be:
mysql -h servername -u dbusername -p databasename < /path/to/cwhois.sql
- Importing The Database via phpMyAdmin: Go to phpMyAdmin in your Web browser and select the database to which you wish to import the dump by clicking on the name. If you have multiple databases, you will need to select the name from the drop-down menu. In the right-hand frame, you will see a row of links. Click on [SQL]. You will see a large input box for queries and below that you will see a smaller box labeled Browse. Click the [Browse] button, navigate to and select the CountryWhois dump file on your home computer and click on [Go]. Warning: There are sometimes file size limitations on importing a database dump this way. If your database is too large, you might encounter PHP timeout errors. In that case, you will need to attempt to restore your database via SSH/Telnet.
- Use one of the examples listed below.
Using the Database in Binary File Format
If your Web hosting account doesn't support MySQL or if you don't want to use MySQL, you can use a binary database file:
- Download the database in binary format (available in the member area).
- Extract and copy the files (cwhois.xml and cwhois.cwb) to your Web site root folder.
- Use one of the examples listed below.
CountryWhois Usage Examples
PHP using MySQL
PHP using a binary file
Perl using MySQL
Perl using a binary file