1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
"http://www.w3.org/TR/html4/strict.dtd">
6
<title>Autoconf Macro: ac_prog_mysqladmin</title>
7
<link rel="stylesheet" type="text/css" href="ac-archive.css">
11
<table summary="web navigation" style="width:100%;">
14
<td style="width:50%;" align="center">[<a href="index.html">Macro Index
17
<td style="width:50%;" align="center">[<a href=
18
"../m4source/ac_prog_mysqladmin.m4">Download M4 Source</a>]</td>
24
<h1>ac_prog_mysqladmin</h1>
29
<p style="text-align:left; white-space:nowrap;">
30
<code>AC_PROG_MYSQLADMIN</code></p>
36
<p>Check for the program 'mysqladmin' let script continue if exists &
37
works pops up error message if not.</p>
39
<p>Testing of functionality is by invoking it with root password 'rootpass'
40
and a 'flush-privileges' command.</p>
42
<p>Besides checking mysql, this macro also set these environment variables
45
MYSQLADMIN = which mysqladmin
46
MYSQL_DATADIR = directory containing mysql database
53
<p>1.4 (last modified: 2003-01-09)</p>
59
<p>Gleen Salmon <gleensalmon@yahoo.com></p>
62
<h2>M4 Source Code</h2>
65
<pre class="m4source">
66
AC_DEFUN([AC_PROG_MYSQLADMIN],[
67
AC_REQUIRE([AC_EXEEXT])dnl
68
AC_PATH_PROG(MYSQLADMIN, mysqladmin$EXEEXT, nocommand)
69
if test "$MYSQLADMIN" = nocommand; then
70
AC_MSG_ERROR([mysqladmin not found in $PATH])
72
AC_MSG_CHECKING([if mysqladmin works])
73
if $MYSQLADMIN -u root -prootpass flush-privileges; then
76
AC_MSG_NOTICE([Before installation, set MySQL root password to rootpass; restore your root password afterwards.])
77
AC_MSG_ERROR([mysqladmin cannot run with root password = rootpass])
79
DATADIR_PATTERN='^|[[[:blank:]]]*datadir[[[:blank:]]]*|[[[:blank:]]]*\([[^[:blank:]]][[^[:blank:]]]*\)[[[:blank:]]]*|'
80
MYSQL_DATADIR=`$MYSQLADMIN -u root -prootpass variables 2> /dev/null | grep $DATADIR_PATTERN | sed "s/$DATADIR_PATTERN/\1/"`;dnl
88
<a href="COPYING.html">GNU General Public License</a> with this special
89
<a href="COPYING-Exception.html">exception</a>.