problems running mysql_install_db5 (was Re: Please send contents of current mysqld file)

Bayard Bell buffer.g.overflow at googlemail.com
Wed Mar 16 11:09:13 PDT 2011


I'm looking at this and trying to decide where it's going wrong:

# my_print_defaults so that we can execute it first, then later re-parse
# the command line to add any extra bits that we need.
parse_arguments PICK-ARGS-FROM-ARGV "$@"

#
# We can now find my_print_defaults.  This script supports:
#
#   --srcdir=path pointing to compiled source tree
#   --basedir=path pointing to installed binary location
#
# or default to compiled-in locations.
#
if test -n "$srcdir" && test -n "$basedir"
then
  echo "ERROR: Specify either --basedir or --srcdir, not both."
  exit 1
fi
if test -n "$srcdir"
then
  if test -z "$builddir"
  then
    builddir="$srcdir"
  fi
  print_defaults="$builddir/extra/my_print_defaults"
elif test -n "$basedir"
then
  print_defaults=`find_in_basedir my_print_defaults bin extra`
  if test -z "$print_defaults"
  then
    cannot_find_file my_print_defaults $basedir/bin $basedir/extra
    exit 1
  fi
else
  print_defaults="/opt/local/lib/mysql5/bin/my_print_defaults"
fi

if test ! -x "$print_defaults"
then
  cannot_find_file "$print_defaults"
  exit 1
fi

Reading the documentation for the command at mysql.com appears to confirm my belief that you really don't want --datadir and --basedir to be the same thing. You'll probably also want to run it as the mysql ID rather than defaulting to root (i.e. you dropped the "-u mysql" from the invocation below).

Given that you don't seem very comfortable around a Unix shell, perhaps you might give a second thought to getting a binary distribution of MySQL, GUI administration tools, and commercial support? I don't know much of anything about MySQL–I'm just someone who knows a bit about MacPorts and Unix who's got a bit too much time on his hands to respond to e-mail, and it's pretty clear to me that you're not working from much of a Unix foundation. Given where you're starting from, going the port route is almost certainly putting more distance between you and what you want to do with the software. I don't want to discourage you from learning if that's really what you want to do, but if you really do wish to learn at this level of detail from the systems side, you need to follow instruction and documentation in both their letter and sense (modify your PATH for use with ports, get your sudo invocation right, know what options to choose for the command you're invoking) and, should that not get you as far as you need to go, you need to be willing to work your way through some basic shell code to at least come back with a clearer statement of the problem. Pre-packaged distributions and admin tools are a perfectly reasonable alternative way to get MySQL up and running.

Also, putting replies in as indented with a ">" and in italics is more or less the exact opposite of mail citation conventions. It would be a lot less confusing if my previous message didn't appear to be responding to your response. ;->

Cheers,
Bayard

On 16 Mar 2011, at 16:58, David Gentry wrote:

> >Bayard,
> 
> >Maybe we are making progress.  I am responding to your email:
> 
> Message: 8
> Date: Tue, 15 Mar 2011 02:02:02 +0000
> From: Bayard Bell <buffer.g.overflow at googlemail.com>
> To: David Gentry <localbusinesswebsites at earthlink.net>
> Cc: Ryan Schmidt <ryandesign at macports.org>,	MacPorts
> 	<macports-users at lists.macosforge.org>
> Subject: Re: Please send contents of current mysqld file
> Message-ID: <4DBE94EC-1229-4CF3-A77A-E0681D00B788 at googlemail.com>
> Content-Type: text/plain; charset="us-ascii"
> 
> I've got other ports running and thus don't have a chance at the moment to download and install mysql5-server, but the stock install includes the following:
> 
> if test -z "$basedir"
> then
>  basedir="/usr"
>  bindir="/usr/bin"
>  mysqld="/usr/libexec/mysqld"
>  pkgdatadir="/usr/share/mysql"
> else
> 
> As the post-destroot patches don't appear to change this. Maybe the next thing to try is to set --basedir to /opt/local and probably set --datadir as well and generally check the documentation for the command you've been asked to invoke.
> 
> >Following your suggestion, I ran:
> 
> sudo mysql_install_db5 --basedir=/opt/local --datadir=/opt/local
> Password:
> 
> FATAL ERROR: Could not find my_print_defaults
> 
> The following directories were searched:
> 
>     /opt/local/bin
>     /opt/local/extra
> 
> If you compiled from source, you need to run 'make install' to
> copy the software into the correct location ready for operation.
> 
> If you are using a binary release, you must either be at the top
> level of the extracted archive, or pass the --basedir option
> pointing to that location.
> 
> >I don't understand this result because my_print_defaults5, an alias file, is in /opt/local/bin which was searched.  It appears that mysql_install_db5 could >not properly treat an alias file.  The original, my_print_defaults is in /opt/local/lib/mysql5/bin.
> 
> >Curiously, I ran:
> 
> echo $PATH
> /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
> 
> >Then, using the Finder, I got information about my_print_defaults and discovered that it is an executable file.  So I ran:
> 
> /opt/local/bin/my_print_defaults5
> /opt/local/bin/my_print_defaults5  Ver 1.6 for apple-darwin10.6.0 at i386
> This software comes with ABSOLUTELY NO WARRANTY. This is free software,
> and you are welcome to modify and redistribute it under the GPL license
> 
> Prints all arguments that is give to some program using the default files
> Usage: /opt/local/bin/my_print_defaults5 [OPTIONS] groups
>   -c, --config-file=name 
>                       Deprecated, please use --defaults-file instead. Name of
>                       config file to read; if no extension is given, default
>                       extension (e.g., .ini or .cnf) will be added
>   -#, --debug[=#]     This is a non-debug version. Catch this and exit
>   -c, --defaults-file=name 
>                       Like --config-file, except: if first option, then read
>                       this file only, do not read global or per-user config
>                       files; should be the first option
>   -e, --defaults-extra-file=name 
>                       Read this file after the global config file and before
>                       the config file in the users home directory; should be
>                       the first option
>   -g, --defaults-group-suffix=name 
>                       In addition to the given groups, read also groups with
>                       this suffix
>   -e, --extra-file=name 
> 			Deprecated. Synonym for --defaults-extra-file.
>   -n, --no-defaults   Return an empty string (useful for scripts).
>   -?, --help          Display this help message and exit.
>   -v, --verbose       Increase the output level
>   -V, --version       Output version information and exit.
> 
> Default options are read from the following files in the given order:
> /etc/my.cnf /etc/mysql/my.cnf /opt/local/etc/mysql5/my.cnf ~/.my.cnf 
> 
> Variables (--variable-name=value)
> and boolean options {FALSE|TRUE}  Value (after reading options)
> --------------------------------- -----------------------------
> config-file                       my
> defaults-file                     my
> defaults-extra-file               (No default value)
> defaults-group-suffix             (No default value)
> extra-file                        (No default value)
> 
> Example usage:
> /opt/local/bin/my_print_defaults5 --defaults-file=example.cnf client mysql
> 
> >I got lost here.  My knowledge is not advanced enough to understand this result and construct a command.
> 
> >Am I on the right track?  Where do I go from here?
> 
> >David
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20110316/14ca6677/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1515 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20110316/14ca6677/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: This is a digitally signed message part
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20110316/14ca6677/attachment-0001.bin>


More information about the macports-users mailing list