Command Line, mysql, Programming




How to find mysql variables with a query, specifically data directory

I needed to find out the data directory for mysql. A quick way to do this within mysql is to use the show variables command. mysql> show variables; Which will output something like: +-----------------------------------------+-------------------------------------------------------------------------------------------+ | Variable\_name | Value | +-----------------------------------------+-------------------------------------------------------------------------------------------+ | auto\_increment\_increment | 1 | | auto\_increment\_offset | 1 | | autocommit | ON | | automatic\_sp\_privileges …