6 |
# |
# |
7 |
# Niels Rogalla <niro@magellan-linux.de> |
# Niels Rogalla <niro@magellan-linux.de> |
8 |
# |
# |
9 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/mysqlfunctions,v 1.6 2005-08-18 03:03:25 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/mysqlfunctions,v 1.8 2005-10-09 21:32:33 niro Exp $ |
10 |
|
|
11 |
mysql_command(){ |
mysql_command() |
12 |
|
{ |
13 |
|
|
14 |
local SQL_USER |
local SQL_USER |
15 |
local SQL_PASS |
local SQL_PASS |
50 |
return 0 |
return 0 |
51 |
} |
} |
52 |
|
|
53 |
mysql_enum_colums(){ |
mysql_enum_colums() |
54 |
|
{ |
55 |
local SQL_USER |
local SQL_USER |
56 |
local SQL_PASS |
local SQL_PASS |
57 |
local SQL_HOST |
local SQL_HOST |
107 |
[ "${SHOWTABLES}" == true ] || echo "${i}" |
[ "${SHOWTABLES}" == true ] || echo "${i}" |
108 |
} |
} |
109 |
|
|
110 |
beep3x() { |
beep3x() |
111 |
|
{ |
112 |
echo -en "\a" |
echo -en "\a" |
113 |
sleep 0.7 |
sleep 0.7 |
114 |
echo -en "\a" |
echo -en "\a" |
118 |
|
|
119 |
reach_mysql_server() |
reach_mysql_server() |
120 |
{ |
{ |
121 |
# set connection timeout to 10 secs |
# set connection timeout to 20 secs |
122 |
mysql --connect_timeout=10 \ |
mysql --connect_timeout=20 \ |
123 |
--user="${SQL_USER}" \ |
--user="${SQL_USER}" \ |
124 |
--password="${SQL_PASS}" \ |
--password="${SQL_PASS}" \ |
125 |
--host="${SQL_HOST}" \ |
--host="${SQL_HOST}" \ |
137 |
return 1 |
return 1 |
138 |
) |
) |
139 |
} |
} |
140 |
|
|
141 |
|
mysqldo() |
142 |
|
{ |
143 |
|
mysql_command \ |
144 |
|
"${SQL_USER}" \ |
145 |
|
"${SQL_PASS}" \ |
146 |
|
"${SQL_HOST}" \ |
147 |
|
"${SQL_DB}" \ |
148 |
|
"$@" \ |
149 |
|
&& return 0 || return 1 |
150 |
|
} |