Skip to content

Instantly share code, notes, and snippets.

View pzskc383's full-sized avatar

Alexander D. pzskc383

View GitHub Profile
@pzskc383
pzskc383 / my.cnf
Last active December 19, 2015 22:28
start() in /etc/init.d/mysql on openrc
# /etc/mysql/my.cnf: The global mysql configuration file.
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-5.1,v 1.4 2013/01/20 02:40:02 robbat2 Exp $
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3307
socket = /var/run/mysqld/mysqld-rd.sock
[mysql]
#!/bin/sh
[[ $# > 2 || $# < 1 ]] && exit 1;
[[! hash pass 2>&-]] && exit 2
IFS=$'\n' data=($(pass work/sql-$1))
cmd=" -p'${data[0]}'"
for (( i=1; i<${#data[@]}; i++ )); do