odbx-sql(1)
π odbx-sql(1) β the OpenDBX glow-up π
okay bestie, sit down, hydrate, and let me tell you about odbx-sql β she lives in the OpenDBX section of your manual pages and she is literally the moment. Think of her as the Swiss army knife of talking to databases and an interactive SQL shell. That's right, she does both. Main character energy fr fr. π
β¨ NAME β¨
odbx-sql β Swiss army knife for communicating with databases and interactive SQL shell
π¦ SYNOPSIS π¦
odbx-sql [-?] [-b backend] [-c configfile] [-d database] [-f delimiter]
[-h host] [-i] [-k keywordfile] [-p port] [-s separator] [-u
username] [-w]
πΈ DESCRIPTION πΈ
So odbx-sql is this small and flexible utiltiy (<- yes, that's how it's spelled in the source, we don't gatekeep typos, we celebrate them π
) that talks to the databases supported by the OpenDBX library.
She has two moods:
- Batch mode β her main purpose here is automating tasks in shell scripts that require working with databases. Set it and forget it, no cap.
- Interactive mode β a convenient SQL shell for modifying database content or testing statements. This is where you go poke at things and see what happens. π₯
And the format of the output? You can control it to some extend (<- again, exactly what it says) by defining strings for separation between columns and for delimiting field values. Cute and customizable, we love that for us.
π OPTIONS π
-h,--helpβ Print help, including a short description of all the available options. Baby's first move, honestly.- *
-b,--backend=name* β Name of the database backend that should be used, or the path to the backend library of the OpenDBX driver. Pick your fighter. π - *
-c,--config=configfile* β Configuration file with all the parameters required for connecting to the database. This file can include values for the backend that should be used, the host name or ip address (and maybe the port if required), the database name, and the user and password. The whole point: put these values into the configuration file so you can access them from non-interactive program execution savely (<- yes, savely) without revealing the password anywhere. A full example of such a configuration file is in the EXAMPLES section of this manual, scroll down bestie. π - *
-d,--database=name* β Name of the database on the server, or path to the database file in the local file system. - *
-f,--delimiter=character* β Single character or string that should surround field values which are returned by SELECT-like statements and printed to stdout. Yes, surround β she wraps them up like little gifts. π - *
-h,--host=name* β Host name, IP address, or path to the database file. It can also be the path to a named pipe in order to communicate to the database server only locally. (And yes, the manpage really does hand-hto both--helpand--host, we are simply reporting the lore as it is. π) -i,--interactiveβ Run in interactive mode and get a convenient SQL shell, contrary to batch mode which is waiting for input from stdin and printing results to stdout. Peak hangout mode. β¨- *
-k*keywordfile β Location of a keyword file used for providing auto-completion of keywords. Tab-tab-tab your way to greatness. - *
-p,--port=port* β TCP/IP port name or number the database server is listening to. If this parameter isn't added at the command line, most database client libraries use the default value. Many but not all database server can resolve the port number from its name, and for a maximum of portability the parameter value should be the port number. Translation: just give her the digits. π’ - *
-s*separator β Single character or string that should separate field values which are returned by SELECT-like statements and printed to stdout. (This one sits between,-fwraps around. Two different jobs, both iconic.) - *
-u,--username=name* β Name of the user which is sent to the database server for authentication. Who are you today? π -w,--passwordβ Prompt for a password at the command line. Secretive, mysterious, we stan. π΅οΈ
π§ EXAMPLES π§
Configuration file
backend = mysql
host = localhost
port = 3306
database = test
username = myuser
password = secret
Starting in interactive mode
odbx-sql -c mysql.conf -i
Executing commands in batch mode
cat stmt.sql | odbx-sql -c mysql.conf
π EXIT STATUS π
odbx-sql returns 1 if an error occured (<- keepin' the original spelling, always) and 0 if all commands succeeded or only warnings are reported.
β οΈ If warnings occur, they are written tostderr. So like, check yourstderr, bestie. Don't let warnings float off into the void unnoticed. π
and that's the whole page!! π this little cutie is OpenDBXβs odbx-sql(1), dated 6 February 2026 β go forth, connect to your databases, and slay. periodt. π
π«Άπ
π¦ where this page comes from
- ubuntu resolute: opendbx-utils 1.4.6-18build2
- ubuntu stonking: opendbx-utils 1.4.6-18build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms