PolarLava::MyClient::Documentation - A MySQL Web Client (original) (raw)
Last Updated: January 21, 2008
Introduction top
The most current version of this documentation can always be found on the MyClient homepage. This documentation is for versions >= 3.0.0. If you are looking for documentation for V1.x or V2.x, you will find that here.
MyClient is a simple MySQL web client interface. Largely it is a web-ified version of the "MySQL" command-line query interface with the added benefit of multiple connection interfaces. It does not contain a lot of bells and whistles like some other MySQL administrative oriented programs such as the very good phpMyAdmin. The target audience of MyClient are those who want a fast, simple web based MySQL query interface and/or those who don't want or need the helper tools provided by a full bore administrative package.
MyClient is ideally suited for those who have web sites that are virtually hosted and they only have access to their database(s), not the entire MySQL database server. It's also ideal for those who have SSH access to their server, but because of an idle timeout frequently get disconnected. This was one of the primary reason this application was originally developed. MyClient allows you to quickly and easily connect and rule your little corner of the MySQL universe.
Features top
- Runs with PHP Register Globals OFF.
- Validates as XHTML Strict Compliant.
- Validates as CSS Compliant.
- CSS control of display layout.
- Session support so you may leave MyClient and return without having to login again.
- Multiple (with a default of 5) SQL query interface windows. Each interface stores its query window contents in session so you can switch between interfaces without losing your current work.
- Ability to save and load queries. These queries can either be saved on the server, downloaded or e-mailed to multiple recipients.
- One click query result sorting by simply clicking on the column name.
- One button table describe and indexing information.
- One button database switching functionality.
- Ability to save query results. These results can either be saved on the server, downloaded or e-mailed to multiple recipients.
- Fully localized to allow all displaying in the language of your choice. Currently MyClient includes English, German, Japanese and Spanish language files.
Requirements top
- PHP4 >= 4.1.0
- MySQL
- Web Server
- Web Browser w/cookies enabled
Installation top
- Download a MyClient release.
- Untar the archive in your web directory. A directory will be created of the format "myclient_vXX", where "XX" is the version number. (e.g. "myclient_v300" for MyClient V3.0.0)
- Rename the directory to "myclient" (or whatever you'd like to call it) or create a "myclient"" symbolic link to the current release directory.
- Review and complete if necessary the creation of a .htacess file as covered in the .htaccess section below.
- If you are upgrading from a previous version, please skip to the Upgrading from a previous version section below.
New Users:- In the MyClient config directory (myclient/config/), copy config.php.dist to config.php
- Edit the config.php file to setup your configuration. See the Configuration section below for information on the various configuration options.
- Point your web browser at: http://www.your-domain.com/myclient/
- Enjoy!
Upgrading from a previous version top
If you are upgrading from an older version of MyClient, this section contains instructions on any necessary steps that must be taken to install the newer version. You should review the MyClient HISTORY file to see a complete list of changes made in the release. The following are the standard upgrade procedures:
- Begin by following the instruction in the Installation section above. You will be told when to return here.
- Copy your configuration file (myclient/config/config.php) to your upgraded installation.
- You advised to read the HISTORY file and check the Development Blog for more information.
- V2.5.1 to V3.0.0 (Hydra)
- Perform the general Upgrading instructions above.
- Because MyClient V3.0.0 is a complete rewrite, the configuration file is completely new. You will need to follow the instruction for a new installation to upgrade to this version.
- V3.0.0 to V3.0.1
- V3.0.1 is very minor bug fix for V3.0.0. If you are already running V3.0.0, there is no need for you to upgrade.
- V3.0.1 to V3.0.2
- V3.0.2 is a bug fix to correct a problem with overly restrictive data validation preventing valid user or hostnames from logging in. There are no configuration changes in this release so you only need to perform the general Upgrading instructions above.
- V3.0.2 to V3.1.0 (Night Monkey)
- Perform the general Upgrading instructions above.
- The following configuration options have been added:
* Added the MYSQLI_ENABLE configuration option. - No further actions are required.
- V3.1.0 to V3.1.1
- V3.1.1 is a bug fix to correct a seriously broken MySQL connection/login problem. There are no configuration changes in this release so you only need to perform the general Upgrading instructions above.
- V3.1.1 to V3.1.2
- V3.1.2 is a bug fix to disable set_time_limit() when PHP Safe Mode is enabled.
- Japanese language translation files in EUC-JP, Shift-JIS and UTF-8 formats as graciously donated to the project by Taira Hajime have been added.
- There are no configuration changes in this release perse, so you only need to perform the general Upgrading instructions above. Obviously TIME_LIMIT is now disabled when running in PHP Safe Mode.
- V3.1.2 to V3.1.3
- V3.1.3 primarily fixes the problem with not being able to save query results.
- There are no configuration changes in this release per se, so you only need to perform the general Upgrading instructions above.
- V3.1.3 to V3.1.4
- V3.1.4 fixes a problem with the interface HTML being appended to saved queries or results when downloaded.
- There are no configuration changes in this release per se, so you only need to perform the general Upgrading instructions above.
- V3.1.4 to V3.2.0
- Updated to operate with E_STRICT error_reporting.
- Added support to display serialized and session data.
- There are no configuration changes in this release per se, so you only need to perform the general Upgrading instructions above.
- V3.2.0 to V3.2.1
- Bad path for include corrected.
- There are no configuration changes in this release per se, so you only need to perform the general Upgrading instructions above.
.htaccess File top
If your PHP installation is running with register_globals ON (very common on hosted/ISP systems), it is HIGHLY RECOMMENDED that it be turned off for MyClient. It is recommend that use_trans_sid (more info/why?) which allows session ID's to be appended to a URL also be disabled as it too is a potential security risk. If your hosting provider (ISP) supports .htaccess files (as most do), then you can create a .htaccess file in your MyClient directory. This file should have 644 (u+rw,g+r,o+r) permissions and contain the following:
<IfModule mod_php5.c>
php_flag register_globals off
php_flag session.use_trans_sid off
</IfModule>
Configuration top
There are a number of user configurable options that affect the way MyClient looks and behaves. All user adjustable settings are contained in the "config.php" file located in the "config" sub-directory. For a new installation you will need to copy "config.dist.php" to "config.php". Below is a listing of the various configuration options, their default values and an explanation of what each option does.
Paths & Session Configuration top
Configuration Option | Default Value |
---|---|
BASE_URL top | http://www.your-domain.com/ |
This is the default URL of MyClient. This value is automatically set and in most cases should not need to be changed. | |
LIB_PATH top | /your/path/to/public_html/myclient/lib/ |
This is the full directory path to the MyClient libraries. This value is must be uniquely set for each installation. | |
MYSQLI_ENABLE top | FALSE |
If you are running a version of PHP5 then you can enable MyClient to use the MySQL Improved Extension. When this option is enabled it will disable the db_connect Database Configuration Option. | |
SESSION_NAME top | MyClient |
This is the name of your MyClient session. It should not need to be changed, but if you feel the need you can do so here. | |
SESSION_SAVE_PATH top | /tmp/ |
This is the full directory path to where MyClient session files are stored. This is a major security risk, particularly if you are using MyClient on a virtually hosted server. It is HIGHLY RECOMMENDED that this be set to a directory within your user directory space if you are running on a virtual host. The directory permissions must be set such that the web process can read and write to this directory to maintain your session data. It is best to choose a directory outside of your web space. If you do need to create it within your web directory, you should create a ".htaccess" file to prevent a browser from being able to view the contents of the directory. | |
TIME_LIMIT top | 180 |
This is the maximum execution time in seconds for all requested queries. See the PHP set_time_limit() manual page for more information. This configuration option is disabled when running in PHP Safe Mode. |
Localization top
MyClient provides the ability to localize your configuration to display all system text, dates and times in your local format. Localization support was added in MyClient V3.0.0.
Configuration Option | Default Value |
---|---|
I18N_LANG top | en_US |
This defines the language and country for your MyClient installation. For information on how to set this language and country option, please see this language code and this country code information. If you are changing this setting you may need to also change the I18N_CHARSET and $config['rss']['encoding'] settings. | |
I18N_CHARSET top | iso-8859-1 |
This defines the character set that your MyClient will utilize. For information on setting this option, please see this character set information page.nbsp; If you are changing this setting you may need to also change the I18N_LANG and $config['rss']['encoding'] settings. | |
setlocale() top | Commented out |
If you are using MyClient in a language other than English, you may need to enable and configure this PHP function for your system. If it is required, typically you would set this to the same value as your I18N_CHARSET setting: setlocale(LC_ALL, 'es_ES') for Spanish or setlocale(LC_ALL, 'de_DE') for German. For more information see the PHP setlocale() manual page. |
Display Configuration top
MyClient has a number of settings that affect its look and operation.
Configuration Option | Default Value |
---|---|
CSS top | style.css |
This defines the CSS file to use with MyClient. If you change this value, the new file should be located in the myclient/css/ directory. | |
TABS top | 5 |
This defines the number of interface tabs to use with MyClient. The only practical limit to the number of tabs you can have is what you can mentally handle. At some unknown quantity, system resource also may become and issue, but it is unlikely that you will ever reach this limit if you use a little common sense. | |
WINDOW_ROWS top | 10 |
This defines the height of the interface query window. | |
WINDOW_COLS top | 107 |
This defines the width of the interface query window. You may need to adjust this value depending on your screen resolution and also on the width your browser window. |
Save Defaults top
MyClient provides the ability save your queries and query results in a number of different ways. The following setting set the default values for the save options.
Configuration Option | Default Value |
---|---|
GZ_DEFAULT top | FALSE |
This boolean value sets whether the GZip file compression radio button option is selected. When set to FALSE, the None option will be the default. | |
OUTPUT_DEFAULT top | dl |
This option selects the default output destination. Your choices for this option are "dl" for downloading the output, "email" to email the output, or "file" to save the output to a file on your server. | |
SAVE_DIR_DEFAULT top | /home/your_home_dir/ |
This value sets the default directory location when you choose to save to a file on your server. | |
MAIL_TO_DEFAULT top | you@your-domain.com |
This value sets the default email address when you choose to email your saved information. You may enter multiple addresses for this field if you separate them by a comma. | |
INC_COL_DEFAULT top | TRUE |
This boolean value sets the default as to whether the table column names should be included when you save query results. | |
DELIMIT_DEFAULT top | " |
This values sets the default data delimiter character(s) when you save query results. | |
SEPARATOR_DEFAULT top | , |
This values sets the default data separator character(s) when you save query results. | |
NEWLINE_DEFAULT top | empty string |
This values sets the default newline replacement character(s) when you save query results. |
Output Compression top
MyClient provides the ability to compress your saved queries, query results and the HTML output to your browser. The following settings will allow you to utilize these options if your PHP installation was built with support for Zlib Compression.
Configuration Option | Default Value |
---|---|
GZ_LEVEL top | 0 |
This sets the default GZip compression level if you choose to save your results in a GZipped file. This value can be set from 0 (none) to 9 (maximum) compression level. A setting of 9 is recommended if you use this option. | |
GZ_LEVEL_PAGE top | 0 |
This sets the default GZip compression level if you choose to GZip compress the page output to your browser. This value can be set from 0 (none) to 9 (maximum) compression level. A setting of 6 is recommended if you use this option. |
Mail Setup top
MyClient provides the ability to email your saved queries and query results. The following settings will allow you to utilize this option. MyClient uses the PHPMailer class to send email.
Configuration Option | Default Value |
---|---|
MAIL_TYPE top | smtp |
This sets the type of mailer you want to use. Options available are "smtp", "sendmail" or "mail". | |
MAIL_HOST top | your-domain.com |
This sets the value of your mail host. Typically this would be your domain name. | |
MAIL_FROM top | you@your-domain.com |
This sets the email address of the user you want MyClient to send mail as. | |
MAIL_FROM_NAME top | MyClient |
This sets the email name of the user you want MyClient to send mail as. |
Database Configuration top
The MyClient database configuration section is a bit different than the constant definitions of the other configuration settings. The database configuration is a multi-dimensional array (hash) that consists of a default configuratin for any undefined tabs (element 0) and as many tab (elements) configurations you care to define.
Database Configuration Explanation top
Each level of the database configuration array defines the connection parameters for a tab (or the default) and consists of the following sub-elements:
Parameter | Typical Value |
---|---|
db_host top | localhost |
This sets the database connection hostname (server). | |
db_user top | your_username |
This sets the database connection username. | |
db_name top | your_db_name |
This sets the database name to which you want to connect. | |
db_connect top | standard |
This sets the database connection type. Valid options are "standard" or "persistent". This option is ignored when the MYSQLI_ENABLE option is enabled. | |
db_port top | 3306 |
This sets the port number that the database host communicates on. | |
db_list top | AUTO |
This option can either be set to "AUTO" or and array of values. When set to AUTO, MyClient will automatically generate a list of databases available from MySQL. If you would like to specify a list of other database which can be switched too from this login, you can define an array of database names. This is an optional that if excluded, will disable the ability to switch from the currently connected database. |
Database Configuration Example top
The following example shows how to configure a default connection parameter (element 0) and different connection parameters for tab interfaces #1 and #2. Tab #1 uses the AUTO db_list option, while tab #2 uses a defined list for the db_list option. Assuming you were using the default of 5 tabs, tabs 3, 4 and 5 would use the default connection parameters.
//--- Database Connection
$db_connect = array(
0 => array(
'db_host' => 'localhost',
'db_user' => 'your_username',
'db_name' => 'your_db_name',
'db_connect' => 'standard',
'db_port' => 3306
),
1 => array(
'db_host' => 'localhost',
'db_user' => 'override_username',
'db_name' => 'override_db_name',
'db_connect' => 'standard',
'db_port' => 3306,
'db_list' => 'AUTO'
),
2 => array(
'db_host' => 'localhost',
'db_user' => 'override_username',
'db_name' => array('db_name1', 'db_name2', 'db_nameN'),
'db_connect' => 'standard',
'db_port' => 3306,
'db_list' => array('db_name1', 'db_name2', 'db_nameN')
),
);
Operation top
Most of the operations within MyClient are fairly self-explanatory. If you do run into problems and have a question, or if you have a suggestion for improvement/enhancement, please either join the MyClient Mailing List, or email me directly: kevinp ~AT~ polarlava.com.
A. Acknowledgments top
MyClient would not exist if not for the contributions and support of a number of people and their work.
- Philipp Becker. Philipp provided the German language translation file.
- Vicente D.Fernandez. Vicente provided the Spanish language translation file.
- PHPMailer Team. For the PHPMailer class.
MyClient is copyright 2001-2008 Kevin L. Papendick. Other sub-components packaged with MyClient are copyrighted by their respective owners.