dbkiss


Database administration tool for MySQL, PostgreSQL and SQLite

DBKiss - database administration tool for MySQL, PostgreSQL and SQLite

DBKiss is a single php file administration script for mysql, postgresql and sqlite databases (sqlite available in 2.00). It is easy to upload to your webserver because it is only a single file, it's straightforward to use and the interface is kept simple.

Download

Stable

Version 1.16: dbkiss_1.16.zip (36 KB) (2014-01-04) see changelog

Beta

This version introduces support for SQLite databases (read section "SQLite configuration" in comments at the top of the file), new layout is still unfinished and some stuff might not work, hence the "Beta".

Version 2.00 Beta: dbkiss_2.00_beta.zip (61 KB) (2012-01-07)

Support development

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VSLE28362TQBY'>https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif' />

Screenshot (branch 1.x)

https://dbkiss.googlecode.com/git/screenshot.jpg

Donations

  • 2014-01-04: Patrick McGovern sponsored development of the Permalinks for saved SQL templates (Issue 3)
  • 2011-05-29: Patrick McGovern sponsored development of the clickable links in data output and their safe redirection.
  • 2011-03-09: Patrick McGovern sponsored development of the Views feature.
  • 2011-01-08: Patrick McGovern sponsored development of the CSV export feature.

Did you know?

  • That importing data from sql files is about x10 times faster than phpMyAdmin? I often had problems with executing sql larger than a few megabytes in phpMyAdmin, in most cases scripts hang up and makes it even impossible, using dbkiss you can do this in just seconds and it works.
  • That dbkiss is compatible with mysql 3.23 through 5.x, so you can use it even on old servers with old mysql version? It also works on php4 and latest php 5.3 with most strict error reporting being set (note: 2.00 beta works only on php5 or higher)

Sql editor features

  • Precede the query with "@" char (also check "only marked") and only such will be executed. It's quite useful behaviour mostly found only in desktop database applications where you can select part of the queries and execute only them.
  • Ever forgot to put "WHERE" in your UPDATE or DELETE query? And catastrophe is ready! DBKiss will detect any queries which are missing "WHERE" condition and will inform you. If you still would like to execute such query on all records in a table just put "WHERE 1=1" and it will let you do it. This feature might save your life someday.

Notes

  • Pgsql driver does not support export of structure.
  • Some of the features in the SQL editor require creating 'dbkiss_sql' directory, where history of queries is kept and other data. If the script has permission it will create that directory automatically, otherwise you need to create that directory manually and make it writable. At the top of dbkiss.php there is defined constant called 'DBKISS_SQL_DIR', you can set it to empty '' string, so the script won't try to create/use dbkiss_sql directory, but some of the features in the sql editor will not work (templates, pagination). That directory is protected with 2 files being created automatically: .htaccess (deny from all) and index.html
  • Export of all structure and data does take into account the table name filter on the main page, so you can filter the tables that you would like to export.
  • All your history of queries is held in "dbkiss_sql" directory, you don't even have to save queries as templates to access them (but it's easier), you could just go to that directory and use "find in files". Got some sophisticated set of queries a month ago and need it now again? Just search it in that directory and save your lunch.

Auto connect script

This little script will automatically connect to given database, so you don't have to fill the data on the connect screen anymore. This is useful on local developer machine, or if you already have some directory protection and asking for the password again is not needed.

"mysql_local.php" source:

``` FILE)).'_'); define('DBKISS_SQL_DIR', 'dbkiss_mysql');

$cookie = array( 'db_driver' => 'mysql', 'db_server' => 'localhost', 'db_name' => 'test', 'db_user' => 'root', 'db_pass' => 'toor', 'db_charset' => 'utf8', 'page_charset' => 'utf-8', 'remember' => 1 );

foreach ($cookie as $k => $v) { if ('db_pass' == $k) { $v = base64_encode($v); } $k = COOKIE_PREFIX.$k; if (!isset($_COOKIE[$k])) { $_COOKIE[$k] = $v; } }

require './dbkiss.php'; ?>```

Changelog

1.16 (2014-01-04)

  • Compatibility fixes for PHP 5.5.7
  • Permanent links for saved SQL templates, the url in browser includes template name (Issue 3)
  • After connecting to database you will be redirected to the url you came from

1.15 (2013-05-05)

  • Fixed Postgresql 9 bug on Linux, no data rows were displayed for SELECT queries in the SQL editor (Issue 5).

1.14 (2012-08-05)

  • IIS server fixes: $_SERVER['SERVER_ADDR'] missing

1.13 (2012-01-07)

  • Table names and column names may start with numeric values ex. 62-411.

1.12 (2011-07-30)

  • Fixed ORDER BY bug in views.

1.11 (2011-05-29)

  • Links in data output are now clickable. Clicking them does not reveal the location of your dbkiss script to external sites.

1.10 (2011-03-09)

  • Support for views in Postgresql (mysql had it already).
  • Views are now displayed in a seperate listing, to the right of the tables on main page.
  • Secure redirection - no referer header sent - when clicking external links (ex. powered by), so that the location of the dbkiss script on your site is not revealed.

1.09 (2011-01-08)

  • CSV export in sql editor and table view (feature sponsored by Patrick McGovern)

1.08 (2010-11-04)

  • date.timezone E_STRICT error fixed

1.07 (2010-08-04)

  • mysql tables with dash in the name generated errors, now all tables in mysql driver are enquoted with backtick.

1.06 (2010-07-18)

  • postgresql fix

1.05 (2010-05-21)

  • export of all structure and data does take into account the table name filter on the main page, so you can filter the tables that you want to export.

1.04 (2010-02-20)

  • exporting of all structure/data was fixed (ob_gzhandler flush bug) cookies are now set using httponly option

1.03 (2010-02-11)

  • re-created array_walk_recursive for php4 compatibility
  • removed stripping slashes from displayed content
  • added favicon (using base64_encode to store the icon in php code, so it is still one-file database browser)

1.02 (2009-10-24)

  • works with short_open_tag disabled
  • code optimizations/fixes
  • postgresql error fix for large tables

1.01 (2009-xx-xx)

  • fix for mysql 3.23, which doesnt understand "LIMIT x OFFSET z"

1.00 (2009-02-10)

  • bug fixes
  • minor feature enhancements
  • this release is stable and can be used in production environment

0.61 (2008-04-18)

  • upper casing keywords in submitted sql is disabled (it also modified quoted values)
  • sql error when displaying table with 0 rows
  • could not connect to database that had upper case characters

Todo list

  • php error handler which cancels buffer output and exits on error
  • XSS and CSRF protection.
  • connect screen: x create database (if not exists) charset
  • connect screen: database (optional, if none provided will select the first database the user has access to)
  • mysqli driver (check if mysql extension is loaded, if not try to use mysqli)
  • support for the enum field type when editing row
  • search whole database form should appear also on main page
  • improve detecting primary keys when editing row (querying information_schema for mysql > 4)
  • when dbkiss_sql dir is missing, display a message in sql editor that some features won't work (templates, pagination) currently it displays a message to create that dir and EXIT, but should allow basic operations is not valid anymore probably, it allows operations even without that directory, but there is still an aesthetic need to enhance that messaging
  • "Insert" on table view page
  • edit table structure

Copyright and license

Copyright (c) Czarek Tomczak. All rights reserved.

Licensed under New BSD License (free for any use, read more at http://www.opensource.org/licenses/bsd-license.php)

Project Information

The project was created on Mar 8, 2012.

Labels:
Database PHP MySQL PostgreSQL Sqlite