I want to do some MySQL-specific testing and need to run a fresh MySQL database as non-root user. I am using Debian Linux and expect one could start the mysql_install_db
and other commands as normal user with the right options and writable locations.
Does this work?
How to do it?
I don't want to download software from the MySQL website. Instead I want to use the executables provided by the already installed OS packages. The reasoning is this:
The software is already installed--installing new software from the net is pointless, slow, might fail, possibly a security risk etc. To my knowledge KDE is doing something similar for its data storage.
If it does eventually work I want to wrap the test in a portable script that runs on any computer where
mysql_install_db
etc. are available.
I searched the web for tutorials/hints but only found loads of descriptions on how to install the software from scratch. With information from what I had read I then tried this:
mkdir ~/tmp/mysql/
mkdir ~/tmp/mysql/mysql/
mkdir ~/tmp/mysql/sql_data/
mysql_install_db \
--defaults-file=my.cnf
--user=daniel
--basedir=/home/daniel/tmp/mysql/mysql/
--datadir=/home/daniel/tmp/mysql/sql_data/
--socket=/home/daniel/tmp/mysql/socket
But it complains:
FATAL ERROR: Could not find my_print_defaults
The following directories were searched:
/home/daniel/tmp/mysql/mysql//bin
/home/daniel/tmp/mysql/mysql//extra
UPDATE: I still didn't find a solution to limiting the output to error messages. I get many lines with the tag [Note]
but didn't find an argument to set debug output level.
/home/daniel/tmp/mysql/mysql/bin
at the beginning of this process? Anything?bin
andextra
don't exist. I updated my question to reflect which directories I created. As you see I created them from scratch. They're empty.