I’ve spent years using phpMyAdmin (much to my chagrin). And I’ve recently warmed up to MySQL Workbench. But it wasn’t until this week that I stumbled across Adminer, a single-file PHP application for MySQL administration.
It’s hard not to be impressed by Adminer, which is both devilishly simple and elegantly designed. The file downloads as adminer-2.3.2.php
; save it as index.php in a folder named adminer
, then navigate to http://servername.com/adminer/
. Supply the name of your MySQL server (adding a colon if it’s hosted on a non-standard port), your username, and password, and you’re off!
(Tip: Bookmark this page! If you go directly to http://servername.com/adminer/
, you’ll need to re-supply your MySQL server credentials.)
Once inside, you can use Adminer to perform most of the basic administration tasks you would perform using phpMyAdmin, MySQL Workbench, or the MySQL command line tools. After using Create Database to add a new schema, for exampl,e you can populatetyour schema using Create Table. The Create Table interface is bare-bones, but also functional: immediately after you finish typing a column name, Adminer auto-adds another blank row for the next column.
Once you’ve created your new table, you can add indexes, key constraints, and triggers. You can review, insert, and delete data using a similarly clean and simple interface.
On the design side, Adminer is extremely theme-able. If you don’t like the default plain Jane style, download one of the adminer.css files from adminer.org, and save it to your adminer directory.
Adminer’s goal is to make the easy things easy: maintaining schemas, reviewing and inserting sample data, and even exporting data are a snap using this script. Like phpMyAdmin and MySQL Workbench, you can inspect the DDL and DML that was executed against your database. The trade-off is that Adminer isn’t as full-featured as its brethren. You won’t get MySQL Workbench’s interactive syntax checking when authoring MySQL. You won’t have phpMyAdmin’s more advanced features, such as server variable configuration and connection management. Many of Adminer’s functions are more limited than those you find in phpMyAdmin. For example, Adminer only dumps tables to two formats (SQL and CSV), compared to phpMyAdmin’s 13.
That said, Adminer does what it does very well. It is easy to install, and lightning fast. I’d recommend keeping this script handy for the majority of your quick-and-dirty MySQL hacking.
Latest posts by Jay Andrew Allen (see all)
- Creating New Linux Users and Login Keys on Amazon EC2 - December 22, 2010
- Upload Files to Your Amazon EC2 Server using WinSCP - December 16, 2010
- How to Point a Domain to an Amazon EC2 Virtual Server - December 8, 2010
11:02 am
I’m glad you are satisfied with Adminer. Variables list is linked from the server page (displayed on your screenshot). But maybe you think defining something in config.inc.php? Have you ever used different export format than SQL or CSV, for example LaTeX?
4:16 pm
Hi Jakub,
Yes – XML. An XML export would be very useful.
I didn’t check to see if Adminer’s CSV export was compatible w/ Excel. I know phpMyAdmin offers two different CSV export options, one specifically for Excel. That’s also a key scenario.
Thanks for creating such an excellent tool!
7:11 pm
Thank you for your feedback. Adminer 3 beta (to be released this month) supports two formats for CSV. Regarding XML, do you prefer simple format used by phpMyAdmin ($db: $table: $field: $value) or complex format used by mysqldump (database name=”$db”: table_structure name=”$table”: field field=”$field”, …)?
Regarding defining variables, which ones do you need to set?
4:57 pm
Adminer is a super tool and Adminer 3 has some great features, such as fast database table list view (don’t need to wait for full list) and in-place editing.
5:15 pm
Thanks for sharing this news.
I love the Adminer. It’s great!
5:32 pm
Really worth to try too: SQLBuddy
10:24 pm
Jakub – great to hear on CSV!
I personally prefer the phpMyAdmin format, because I prefer using table and columns names as a domain-specific language.
As for server vars, I don’t know that I care. I’m fine using another tool for the rare times I have to diddle these values. I’m good with Adminer sticking to the basics.
Piotr – it is!
Paolo – I’ll check out SqlBuddy. Thanks for the ref!
5:55 pm
I decided to not implement XML export because everybody requires a different format for it. However, it is now possible (since Adminer 3.1 available in Git) to create an own format for export. You can use a customization to create it: http://www.adminer.org/en/extension/
The example implementation of XML export is here: http://pastebin.com/LHvmDdbm
9:58 pm
Are you please show a step by step instruction for setup adminer with apache?
for beginner…
11:28 pm
I couldn’t figure out what I’m doing wrong here…when I hit the login button, I keep getting a message that says
“No connection could be made because the target machine actively refused it.”
Help?!