MyClient Documentation

Last Updated: January 21, 2008

Contents

Introduction
Features
Requirements
Installation
Upgrading
.htaccess File
Configuration
Operation
A. Acknowledgements


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
Requirements  top
Installation  top
  1. Download a MyClient release.
  2. 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)
  3. Rename the directory to "myclient" (or whatever you'd like to call it) or create a "myclient"" symbolic link to the current release directory.
  4. Review and complete if necessary the creation of a .htacess file as covered in the .htaccess section below.
  5. 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.
  6. Point your web browser at: http://www.your-domain.com/myclient/
  7. 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:

  1. Begin by following the instruction in the Installation section above.  You will be told when to return here.
  2. Copy your configuration file (myclient/config/config.php) to your upgraded installation.
  3. You advised to read the HISTORY file and check the Development Blog for more information.


.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.


MyClient is copyright 2001-2008 Kevin L. Papendick.  Other sub-components packaged with MyClient are copyrighted by their respective owners.