Hello, fellow forum-goers.
This is kind of a random question and searching in all the usual places didn't turn-up any answers. If I have missed this information in the MySQL manual (should somebody find it contained therein), please bring the relevant section to my attention. I have looked and there was no mention of whether or not spaces are permitted in configuration files (I would think they'd have to be) and if so, what sort of escaping might be required.
The manual does say this (about 1/3 of the way down the page - http://dev.mysql.com/doc/refman/5.0/en/option-files.html ):
"This is equivalent to --opt_name=value on the command line. In an option file, you can have spaces around the ‘=’ character, something that is not true on the command line. You can enclose the value within single quotes or double quotes, which is useful if the value contains a ‘#’ comment character or whitespace."
But that doesn't seem to be true, as I shall attempt to support below.
Basically, I want to use a directory with spaces in its name as the data directory for MySQL ("datadir" in the my.cnf configuration file). I am running MySQL 5.0 on Ubuntu Linux. The default my.cnf file looks like this:
[mysqld]
#
* Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
I want to change the datadir value to something more like:
/home/username/MySQL Data/Version 5/
Notice the spaces in the path. Now, if I paste that path name into the my.cnf file in place of the default (/var/lib/mysql), as you would expect, mysql spits back:
df: `/home/username/MySQL/.': No such file or directory
* /etc/init.d/mysql: ERROR: The partition with /home/username/MySQL is too full!
So, clearly, mysql is interpreting the space character as an attempt to denote a new directive (or add an additional parameter to the current value). Naturally, I then attempted to put quotes (both double and single quotes) around the path name. I get the same error.
Is it possible to use spaces the mysql my.cnf file, in the datadir path name value? If so, how? A syntax example would be great.
Thanks for any insight!