Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read/convert mysql history (.mysql_history) containing \040 instead of whitespace?

Tags:

linux

unix

mysql

My .mysql_history looks like:

select\040country,\040count(*)\040from\040city_item\040inner\040join\040city\040group\040by\040year,\040country;

How to convert it into human readable format? Assuming it is too late to configure --without-readline parameter or something else to my.cfg

like image 685
Mladen Adamovic Avatar asked Jan 26 '17 07:01

Mladen Adamovic


People also ask

Where is Mysql_history?

By default, this file is named . mysql_history in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment variable.


1 Answers

Use

sed "s/\\\040/ /g" < .mysql_history
like image 74
Mladen Adamovic Avatar answered Oct 05 '22 10:10

Mladen Adamovic