Bug #36221 | mysql_install_db wants to create directories outside of $PREFIX | ||
---|---|---|---|
Submitted: | 20 Apr 2008 8:42 | Modified: | 30 May 2008 11:31 |
Reporter: | Sebastian Bergmann | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S3 (Non-critical) |
Version: | 6.0 | OS: | Linux |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | mysql_install_db |
[20 Apr 2008 8:42]
Sebastian Bergmann
[20 Apr 2008 9:24]
Hakan Küçükyılmaz
Sebastian, please verify that you have no /etc/my.cnf or /etc/mysql/my.cnf on your system. If so, then please try with --no-defaults as first option. Best regards, Hakan
[20 Apr 2008 9:35]
Sebastian Bergmann
Okay, with --no-defaults it works. Not it is arguable whether --no-defaults should be the default behaviour. At least to me it would be more intuitive to have mysql_install_db create the system tables in the directory I specified as $PREFIX by default.
[20 Apr 2008 10:07]
Sebastian Bergmann
Also imagine what would happen if the user had the privileges required to write to /var/lib/mysql: kaboom.
[20 Apr 2008 10:23]
Sebastian Bergmann
Just noticed that --no-defaults does not show up in mysql_install_db --help: sb@ubuntu mysql-6.0 % ./scripts/mysql_install_db --help Usage: ./scripts/mysql_install_db [OPTIONS] --basedir=path The path to the MySQL installation directory. --builddir=path If using --srcdir with out-of-directory builds, you will need to set this to the location of the build directory where built files reside. --cross-bootstrap For internal use. Used when building the MySQL system tables on a different host than the target. --datadir=path The path to the MySQL data directory. --force Causes mysql_install_db to run even if DNS does not work. In that case, grant table entries that normally use hostnames will use IP addresses. --ldata=path The path to the MySQL data directory. Same as --datadir. --rpm For internal use. This option is used by RPM files during the MySQL installation process. --skip-name-resolve Use IP addresses rather than hostnames when creating grant table entries. This option can be useful if your DNS does not work. --srcdir=path The path to the MySQL source directory. This option uses the compiled binaries and support files within the source tree, useful for if you don't want to install MySQL yet and just want to create the system tables. --user=user_name The login username to use for running mysqld. Files and directories created by mysqld will be owned by this user. You must be root to use this option. By default mysqld runs using your current login name and files and directories that it creates will be owned by you. All other options are passed to the mysqld program
[30 Apr 2008 7:14]
Monty Taylor
I agree about a sensible default install location based on $prefix. It certainly should not just try /usr/local/mysql.
[30 Apr 2008 7:20]
Monty Taylor
ldata="@localstatedir@" It does default to your configured location... I'm guessing that you actually did have a my.cnf somewhere accessible on your system. I do not think that it's a good idea to turn on --no-defaults by default, since this breaks normal expected behavior. I _do_ think that basedir should not default to "", but rather should default to something based on $prefix (like perhaps prefix).
[30 Apr 2008 7:22]
Monty Taylor
One more annoying note from me - Sebastian, I notice you are on ubuntu. If you have the package mysql-common installed, this installed the default ubuntu my.cnf file into /etc/mysql/my.cnf. There is an ongoing discussion about this, as it seems to continue to cause people grief...
[30 Apr 2008 11:31]
MySQL Verification Team
Changing to need feedback to last comment of Monty: /etc/mysql/my.cnf. Please verify. Thanks in advance.
[30 May 2008 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".