Adminer: Database management in a single PHP file
86 points
1 month ago
| 14 comments
| github.com
| HN
mcint
1 month ago
[-]
Can we update the title with the project name, adminer?

I've gently relied on this tool, it's basically delightful to use. Simple to deploy, doesn't fight the protocol and software stack it can be deployed alongside for securing, using. A shining, straightforward FOSS success.

reply
herpderperator
1 month ago
[-]
phpMyAdmin was (is?) such a great tool and really got me into SQL/MySQL over a decade ago. Not to mention the whole PHP stack was so fun to use and let you iterate quickly and just build stuff with an immediate feedback loop - just reload the page and your updated server-side code is executed.
reply
acomjean
1 month ago
[-]
It’s still there and still very good. Our non profits web host has an install and it’s pretty good at browsing/ searching / dumping the tables.

Dbeaver is my stand alone app of choice. It’s Java based but has some nice features as well.

reply
Tostino
1 month ago
[-]
It was the first tool I ever used when I was learning about how to manage a private lineage 2 server in like 2005. Had a MySQL backend and the tutorials I was following had me using phpMyAdmin. I remember fixing a performance problem by changing a setting that (I had no idea what the implications were at the time) got rid of durability entirely on a number of tables, and months later I had to restore from an earlier backup with data loss because of data corruption.

Your right though, the interface really wasn't too terrible. Was definitely better than what was available for Postgres even a few years later when I first had contact with that.

reply
Cthulhu_
1 month ago
[-]
I'm surprised that we've had a number of new languages and advancements in the past ten years or so, but none that tried to fill the same space as PHP & co did... unless I missed it.

But then, I suppose PHP itself is good enough and the people using it never felt a need for anything new. Laravel solved the lack of application structure / design handrails, and Facebook solved or worked on the bigger issues around the language - typing and runtime performance.

reply
bojan
1 month ago
[-]
Symfony is there as well, a framework fit for large enterprise applications, and it works surprisingly well.

Despite that, php has its limits, and it's important to know them, and the workarounds for most of them. What is also tricky is a total lack of support from Azure for example.

reply
aaviator42
1 month ago
[-]
In the same vein, I have a single-file library which allows you to use flat files as key-value DBs. Uses SQLite under the hood. Sharing in case someone finds it useful: https://github.com/aaviator42/storx
reply
colecut
1 month ago
[-]
This is a really neat concept that I think would be fun to use.

Looking at the usage, I thought this syntax was interesting:

//here's how we read a key $sx->readKey('username', $username);

Is there a reason you are requiring a variable to be passed by reference to the readKey function, instead of doing:

$username = $sx->readKey('username');

EDIT: ahh, I see you have a returnKey('key') function that works that way

reply
aaviator42
1 month ago
[-]
Yep! I'm glad you like it! :)
reply
mrweasel
1 month ago
[-]
When I do a Docker-compose development setup, I frequently just throw in an adminner container, just in case. It's a super simple and very well done project.
reply
kenfai
1 month ago
[-]
I'm happy to finally see this got updated a month ago.

I thought this project was abandoned as the last update that doesn't support the more recent PHP version was in 2021.

In my opinion, this is the best single-file DB management tool for quick one-off edit or development purposes since phpMyAdmin.

reply
adrenalinee
1 month ago
[-]
Agree. I've been using this for almost ten years now, and I still impressed at how clean and fast it is.

Sometimes ppl ask why dont just use phpMyAdmin, but most of the time I need to access the database is only for a quick update, peek some data, or a simple query.

reply
benoau
1 month ago
[-]
Another in this vein is "pgweb" for PostgreSQL, just need a binary to run its web interface.

https://github.com/sosedoff/pgweb

reply
hattmall
1 month ago
[-]
reply
yu3zhou4
1 month ago
[-]
Nostalgia hits when I see PHP + MySQL stack. My journey with building things started with XAMPP (looks like it still exists and is maintained https://www.apachefriends.org/). There was a very convenient way for administering DB with their admin panel. In retrospection, despite I had 0 real knowledge in programming and it was like 2009-2010 or so, I think it was easier to build thing with this stack than to build things today. On the other hand, nothing prevents me to start using it again, at least for personal projects.

Does anyone have an experience and can compare Adminer to XAMPP admin panel and modern stack (Supabase and similar)? Or PHP vs React+Node or Python+Django?

reply
cess11
1 month ago
[-]
XAMPP is more like a full application server, while Adminer is similar to PHPMyAdmin, though leaner and with a focus on security and simplicity.

If you, like me, find yourself in possession of databases and need to quickly pull up a simple interface to visually browse them, Adminer is for you. If you need an application development and deployment stack you'll find Adminer solves only a small portion of it.

reply
theanonymousone
1 month ago
[-]
This "in a single file" property is probably the most unique, and maybe the most enviable feature of PHP. I don't think you can do it in any other language, except maybe by jumping through hoops (e.g. jbang and uv come close).
reply
foul
1 month ago
[-]
You can bundle everything in a file in most programming languages. You may find it useful (for sysadmin purposes) only with scripting languages, because with compiled ones you generally "bundle" most of the software in the executable file.
reply
ForTheKidz
1 month ago
[-]
I think a far more enviable thing is that by default the file IS the response body. You can punt on explaining basically the entire web stack until later. You can teach interactive server AND client-side programming without having to explain more about HTTP than GET, POST, path, and the bodies.

Curiously, all the things I used to love about the language I now consider major liabilities and footguns. Outside of wordpress I'd have a hard time recommending it—it's so different from other webserver setups you're likely to prolong your frustration. Not to mention it's an ugly language with an incredibly inconsistent runtime library.

reply
mschuster91
1 month ago
[-]
You can definitely do it in Javascript but without a bundler it becomes quite the pain.

Also, you can do it in C - sqlite's "amalgamation" is proof of that, but they use a bundler tooling IIRC.

reply
cess11
1 month ago
[-]
I do similar things with Elixir scripts, though commonly I still turn to PHP because there is some single file library that does what I want with a lot less ceremony than the Java variety would require.

There's also PsySH, https://psysh.org/, for being something other than a Common Lisp or BEAM interface it's a very nice REPL. Besides Picolisp and iex it's the interactive programming environment I use the most.

reply
hiAndrewQuinn
1 month ago
[-]
Go lets you embed arbitrary files into the binary it creates. If you do that and also compile it to be standalone you have a one-.exe solution.
reply
theanonymousone
1 month ago
[-]
I meant a single source file. Obviously any compiled language delivers one binary file or so.
reply
indigodaddy
1 month ago
[-]
Anyone remember the snews single file CMS? It was pretty great..
reply
geocrasher
1 month ago
[-]
I see adminer misused in malware on WordPress sites way too often. It's too bad its reputation is tarnished that way.
reply
dewey
1 month ago
[-]
So are "ssh", "curl" and file uploads. I don't think it has any impact on the reputation of the tool.
reply
darkwater
1 month ago
[-]
Actually I think it more as a testament to the tool easy of use and deploy, and to its reliability. Otherwise malwares wouldn't use it.
reply
simmo9000
1 month ago
[-]
Less than a minute to install deploy and use. Could not be easier, well done.

Simple and strait forward is always a winner.

reply
Jotalea
1 month ago
[-]
"single" PHP file.

Still a pretty nice tool.

reply
motrm
1 month ago
[-]
To be fair it's the actual releases that are in a single file.

Development evidently happens in the traditional sense with the project in a nicely defined tree.

The build process looks pretty gnarly, but it works! https://github.com/vrana/adminer/blob/master/compile.php

reply
krypttr
1 month ago
[-]
Wow. We have gone full circle.
reply
knowitnone
1 month ago
[-]
reply
ericol
1 month ago
[-]
Like, it's the same?
reply
AgLiAn
1 month ago
[-]
Yes, it is.
reply