Apache:...e::mysql(3)
π NAME π
Apache::DBI::Cache::mysql β it's a plugin for Apache::DBI::Cache, bestie. That's the whole vibe. β¨
π¦ SYNOPSIS π¦
okay so you can either do the one-liner thing:
use Apache::DBI::Cache plugin=>'Apache::DBI::Cache::mysql',
...;
or, if you're feeling β¨extraβ¨:
use Apache::DBI::Cache;
use Apache::DBI::Cache::mysql;
both are valid, pick your fighter π
πΈ DESCRIPTION πΈ
NOTE: bestie, read Apache::DBI::Cache first. like, before this one. fr fr. π
so here's the tea: DBD::mysql lets you use a whole bunch of different DSN syntaxes to connect to the same database server and the same database. which is chaos, honestly. and this plugin? it takes all those messy little DSNs and transforms them into one standard format, which means the DBI handle caching works sooooo much better. π
and ALSO β if port is omitted, the standard port 3306 gets inserted. slay. and the actual database name? it gets deleted from the DSN and replaced with a USE database command instead. iconic behaviour tbh.
so check it β DBI connects to all of these following DSNs as the same user, at different times, and they're actually all performed with the same DSN host=server;port=3306. then USE db[1-3] commands get issued before the handle is handed off to the caller. π«Ά
dbi:mysql:dbname=db1;host=server
dbi:mysql:db2:server:3306
dbi:mysql:port=3306;database=db3;host=server
Apache::DBI::Cache can cache all of them under the same key. so you only need one real database connection instead of 3 without the plugin. the way that's a glow-up πβ¨
and one more thing β mysql_auto_reconnect gets turned off. π
π SEE ALSO π
Apache::DBI::Cache
π AUTHOR π
Torsten Foertsch, <torsten.foertsch@gmx.net> β ty for your service π«‘
with suggestions from:
- Andreas Nolte
< andreas dot nolte at bertelsmann dot de > - Dietmar Hanisch
< dietmar dot hanisch at bertelsmann dot de >and - Ewald Hinrichs
< ewald dot hinrichs at bertelsmann dot de >
the whole squad came through π
π SPONSORING π
sincere thanks to Arvato Direct Services (http://www.arvato.com/) for sponsoring this module and providing a test platform with several thousand DBI connections. several thousand. bestie that's not a test, that's a lifestyle. π₯π
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 by Torsten Foertsch
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π¦β¨ this one's from perl v5.42.0, dated 2025-07-25, and it lives in the Apache:...e::mysql(3) section of the manual. go forth and cache those handles responsibly ππΈπ
π¦ where this page comes from
- fedora 43: perl-Apache-DBI-Cache 0.08-52.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms