New parser: my_print_defaults
See original GitHub issueBoth MariaDB and MySQL provide my_print_defaults
for displaying MariaDB / MySQL configuration.
They are not exactly the same, for example the MySQL version has a -s
option and the MariaDB version doesn’t, but I don’t think the differences would matter for a jc
parser.
Usage examples:
my_print_defaults -c /home/example/.my.cnf client
--user=example
--password=XXX
--socket=/run/mysqld/mysqld.sock
my_print_defaults -c /etc/mysql/mariadb.conf.d/50-server.cnf mysqld
--user=mysql
--pid-file=/var/run/mysqld/mysqld.pid
--socket=/var/run/mysqld/mysqld.sock
--port=3306
--basedir=/usr
--datadir=/var/lib/mysql
--tmpdir=/tmp
--lc-messages-dir=/usr/share/mysql
--skip-external-locking
--bind-address=127.0.0.1
--key_buffer_size=16M
--max_allowed_packet=64M
--thread_stack=192K
--thread_cache_size=8
--myisam_recover_options=BACKUP
--max_connections=80
--max_user_connections=0
--table_cache=64
--thread_concurrency=10
--open_files_limit=122880
--table_open_cache=6000
--tmp_table_size=32M
--join_buffer_size=8M
--max_heap_table_size=32M
--query_cache_type=0
--query_cache_limit=0
--query_cache_size=0
--log_error=/var/log/mysql/error.log
--expire_logs_days=10
--max_binlog_size=100M
--innodb_buffer_pool_size=1G
--innodb_log_file_size=256M
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
I think that producing JSON would be a matter of, for each line of results, removing the --
at the start, then splitting the string at the =
sign.
Note that the use of -
or _
in configuration options is interchangable, perhaps it would make sense to change all dashes in variable names into underscores for consistency?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Eclipse SUMO - Simulation of Urban MObility ...
const bool, myPrintDefaults ... [in], newID, The new id of this object ... Referenced by Distribution_Parameterized::parse(), ...
Read more >UNISYS A Series System Softwa re - Bitsavers.org
This guide provides the reader with information required to make decisions about ... The LOAD command loads a previously generated screen as the...
Read more >System Software Utilities Operations Reference Manual - Unisys
The LOAD command loads a previously generated screen as the new screen. ... commands at the ODT, you can either enter the DA...
Read more >QuickDraw GX Printing Extensions and Drivers - Vintage Apple
Reading, Massachusetts Menlo Park, California New York ... The parse range results enumeration provides the constants that are used as the return.
Read more >Артеменко Ю.Н. - MySQL Руководство администратора | PDF
"my_raid_createf:: undefined reference to "operator new(unsigned)' ... MySQL, mysqladmin parse error near 'SET password' ( 'SET password'). MySQL.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah I can fix that. I already do it for double quotes but didn’t think to do it for single quotes. You can use the -r or raw option to get the quotes back, if needed.
The mysqltuner Perl script has a
--json
output option available afterlibjson-perl
has been installed and this together withmy_print_defaults
and thejc --kv
parser results in so much JSON data that I think this issue can be closed! Thanks for considering it @kellyjonbrazilNote however that some of the variables names have spaces in them so you might need to use something else to filter the results before they can easily be accessed by something like Ansible, for example: