query helper script

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-01-15 17:35:15 -08:00
parent cfb58cd264
commit 92c64c67d6

6
query.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
P=${P:=$(sed -ne 's#^.*mysql://[^:]*:\([^@]*\).*$#\1#p' config/default.json)}
U=${U:=$(sed -ne 's#^.*mysql://\([^:]*\).*$#\1#p' config/default.json)}
DB=${DB:=$(sed -ne 's#^.*mysql://[^@]*@[^/]*/\([^/"]*\).*$#\1#p' config/default.json)}
mysql -u ${U} --password=${P} ${DB}