TurboDbAdmin
Documentation
top
Introduction – Beta Version 0.2.3
TurboDbAdmin is a single-page AJAX solution for exploring and editing databases from a browser. Currently in beta, feature additions and improvements are planned for upcoming releases so please check back at TurboAjax.com regularly. We greatly appreciate your feedback and welcome your contribution to our discussion forums. This release supports:
TurboDbAdmin is published by the TurboAjax Group and was constructed using TurboWidgets, a suite suite of professional Javascript / AJAX enabled user interface controls.
top
Browser Support
TurboDbAdmin has been tested on Firefox, Mozilla, and Internet Explorer 5 or higher. We are working on expanding browser support. Other browsers may be compatible; results will vary.
top
Requirements
  1. Access to a web server, for example Apache or Microsoft IIS with the ability to upload files. See the Apache web site for information about installing the Apache web server.
  2. PHP 4.3 or higher installed on your web server. See the PHP web site for information about installing PHP.
  3. MySql 3 or higher accessible by your web server. See the MySql web site for information about installing MySql. If you enable PostgreSQL support you can administer a PostgresSQL server instead of MySQL. In this case MySQL is not required, but PostgreSQL is. See the PostgreSQL web site for more information about installing PostgreSQL.
  4. Your database server name, user name, and password.
  5. Although not required, you should have the ability to password protect a folder on your web server. See the Security section. (Optional but strongly recommended.)
top
Installation Instructions
To use TurboDbAdmin, it must uploaded and installed on a web server.The following instructions assume that you have downloaded TurboDbAdmin from TurboAjax.com and explain how to upload and configure the application to run from a web server. TurboDbAdmin may be installed and run on a web server running on your local machine or a remote web server.
  1. Make sure you satisfy the Requirements before attempting to install TurboDbAdmin:
  2. Decompress the contents of the installation file to a folder of your choice on your local machine.

    Option: If you prefer, upload the installation file to your web server and decompress it on the server using your shell access. Decompress to a folder of your choice (for example <web-root>/turbodbadmin), and then skip step 4 below.

  3. Navigate to the file /php/config.php, edit it a text editor, and insert the values for your database server name, username, and password. Then save and close the file.
  4. Upload the contents of the TurboDbAdmin folder to a location of your choice on your web server, for example <web-root>/turbodbadmin.
  5. You may choose to password protect the directory in which you have uploaded TurboDbAdmin. See http://www.ssi-developer.net/htaccess/htaccess_protection_simple.shtml for a tutorial on .htaccess password protection. See the Security section. (Optional but strongly recommended.)
  6. Open the url <www.your-host.com>/<your-install-dir>/ in your web browser. If you installed TurboDbAdmin on your local machine, the url will most likely be localhost/<your-install-dir>/.
top
Security

TurboDbAdmin itself does not secure the data in your database. It is your responsibility to maintain the integrity of your data. We recommend controlling access to the application with password protection on the folder containing TurboDbAdmin on your server. At the very least, use a basic authorization scheme. Strictly speaking, this is optional; however, it is strongly recommended since if you do not protect the directory in which TurboDbAdmin resides, anyone browsing TurboDbAdmin on your server will be able to edit your data.

To protect your login credentials (username and password) it is also recommended that TurboDbAdmin be available only via a server address using SSL encryption (an https:// address ). SSL technology can defeat various server attacks.

Detailed public information on basic authorization, SSL technology, and more is available at wikipdedia.org.

top
Using TurboDbAdmin
Browsing table and schema data
Click on a table in the database server tree at the left of the page. The data in the table will be displayed in the grid. To navigate within a table, scroll down the grid or click and drag the page slider to display the desired records.
Click on a column header to sort by that column. To switch between viewing table data and the table schema, click the Data and Schema tabs.
Editing table data
Editing is locked by default to preserve data integrity. Click the Lock button to lock or unlock data editing. Then click in a cell and modify the value.
Edits are saved by row when you move between rows or when you click the Apply Edit button. The Cancel Edit button cancels all edits made to cells in the row being edited. You can move between cells by pressing the TAB key, cancel a cell edit by pressing ESC, and accept a cell edit by pressing ENTER.
Click the Add Row button on the toolbar to add a record. Click the Delete Row button to delete the selected record(s). To select more than one row to delete, hold down the Shift or CTRL keys while clicking on rows.
Please note that clicking the Refresh, Back, or Forward buttons on your browser while in the process of editing a row will abort any edits you've made.
Errors during editing
If an error occurs when edits are being saved to the database server, edits are aborted and table data is refreshed from the server. Any edits made to the row will have to be redone. Errors can occur when entered values are restricted by the database server.
For example, if multiple cells are edited in a row including a duplicate value in the primary key cell, an error will occur. The table will be refreshed and edits will be lost. It is then necessary to redo the desired edits and enter an allowable value in the primary key field.
When an error occurs, a prompt showing available error information is displayed. The error is also logged to the message window at the bottom of the browser page.
Executing SQL
To execute an SQL query, click the SQL tab, enter a valid SQL query in the large text box, and click the Execute SQL button. Multiple queries may be entered, separated by semi-colons. For example, it's possible to export SQL (see Exporting Data) from TurboDbAdmin or another database tool and import it by pasting the queue of SQL queries into the text box and then executing.
SELECT queries will display results in a data grid below the query. Results are shown only for the last command in a queue. Therefore, to process a queue of commands and then see results, enter a SELECT query as the last command.
By default, queries are processed on the database selected in the server tree. This behavior can be overridden by specifying a database within the query (for example, SELECT * FROM my_database.my_table). For a queue of commands, a USE statement may also be, used.
Saving SQL
SQL queries may also be saved. Enter a query and enter a name for the query in the text box next to Save as: and click the Save button. To load a previously saved query, select it from the drop down list. Click the Delete button to delete a selected saved query. Saved queries may be updated by loading the saved item, editing the query, clicking save, and confirming the update. See the Configuration Settings section for server settings related to saving and executing SQL.
Exporting SQL Query Results
When an SQL query is executed that displays results, the results may be exported. Export options are displayed below the grid of result data. Two export formats are supported: CSV and HTML. Choose the desired format and click the Export button.
The exported data will be displayed in a text box. Select the text, copy, and paste it into the application to which you want to export data. To export additional data, click the Back button. HTML is exported as a <table> HTML entity. If HTML is exported, the Render button may be pressed to see the <table> as it will appear in an HTML page. When the table is rendered, click the Source button to return to the HTML source view.
Exporting Data
Databases and tables are exported using the Export tab. Click the Export tab, set export options as explained below, and click the Export button. The exported data will be displayed in a text box. Select the text, copy, and paste it into the application to which you want to export data. To export additional data, click the Back button.
First select what to export using the grid of items to export. The grid works in conjunction with the server tree. If a table is selected in the server tree, a list of its columns is shown in the grid. If a database is selected in the server tree, a list of its tables is shown in the grid. If a server is selected in the server tree, a list of its databases is shown in the server tree. In the Export column of the grid, check the items to export. Click All or None to quickly check all items or no items. To change the name of the exported item, edit the desired row of the Output Name column.
Depending on the type of data exported, different options are available. When exporting databases or multiple tables, the SQL and SQL schema only formats are available. For databases, in addition to modifying the Output Name column, the exported names can be altered by a database prefix and table prefix. For tables, a table prefix may be entered. When exporting table columns, the supported formats are: SQL, SQL schema only, CSV, and HTML. Check the desired format. Note, when exporting table columns, some columns must be selected or nothing will be exported.
The exported data will be displayed in a text box. Select the text, copy, and paste it into the application to which you want to export data. To export additional data, click the Back button. HTML is exported as a <table> HTML entity. If HTML is exported, the Render button may be pressed to see the <table> as it will appear in an HTML page. When the table is rendered, click the Source button to return to the HTML source view.
top
Configuration Settings
TurboDbAdmin contains two configuration files, one for javascript (/config.js) and one for php (/php/config.php).
Character Set Settings
TurboDbAdmin supports settings for character sets that should be adjusted as follows based on the MySQL version and the character sets of the data stored on the server. The settings are stored in /php/config.php and are called 'encoding' and 'names'. Note that these settings are commented out by default.

MySql version 4.1 or higher
Usage config.php Parameters Data Encoding Database Character Set Notes
Normal Case: data encoding matches server character set. none encoding matches db character set

MySql does all character conversions.
Parameter encoding is utf-8 by default.

Special Case: use when utf-8 encoded data is stored in a table with latin1 character set. names="latin1" utf-8 latin1 Sorting will generally be incorrect
Special Case: use when a specific encoding type (example: big5) is stored in a table with latin1 character set. encoding="<non-utf-8-encoding>"
names="latin1"
non-utf-8 latin1 Requires mb_strings.

MySql version prior to 4.1
Usage config.php Parameters Data Encoding Database Character Set Notes
Normal case: latin character data is stored with the default MySql character set. none iso-8859-1 latin 1 or other iso-8859-1 compatible Parameter encoding is iso-8859-1 by default.
Normal case: specifically encoded data (for example big5) is stored on a server with the matching character set. encoding="<encoding-name>" encoding-name various Sorting reliable only if the specified encoding matches the db character set.
Requires mb_strings.
Special case: use when utf-8 encoded data is stored on a server with the default latin1 character set. encoding="utf-8" utf-8 latin1 Sorting will generally be incorrect
Special case: use when a specific encoding type (example: big5) is stored on a server with the default latin1 character set. encoding="<non-utf-8-encoding>" non-utf-8 latin1 Sorting will generally be incorrect
Requires mb_strings.
top
Troubleshooting Problems
The best source of help to resolve problems running TurboDbAdmin is the TurboAjax discussion forum. The following troubleshooting tips will provide valuable information to help resolve problems and/or to include in posts on the discussion forums.
Enabling Debug Output
In /config.js, change the value for isDebug to true and save the file . The value for debugAtAllCosts should not be changed. When debug output is enabled, a debug window is displayed above the message window when TurboDbAdmin is run. The debug window provides additional explanation of TurboDbAdmin procedures, including error information.
Accessing Troubleshooting Pages
Because TurboDbAdmin employs a host of technologies that must work together in concert, a set of troubleshooting pages is provided to help pinpoint specific problems. These may be accessed from the <www.your-host.com>/<your-install-dir>/troubleshoot. A list of troubleshooting pages is displayed, each with a short explanation of expected results. Any unexpected results should be reported via our discussion forum.
top
Changelog
top
Known Issues
  1. Firefox 1.0.x: mousewheel scrolling does not update the fixed column in the grid because of a known bug in Firefox.