5

I'm not root on my server (linux) and this server doesn't currently run a mysql server as a daemon.

Can I start a mysql daemon that would only work for my account and where the data/files would be stored somewhere in my ${HOME}/... ? How can it be done ?

Thanks, Pierre

5 Answers 5

1

To configure to compile in your directory:

./configure --prefix=/path/to/my/dir
make && make install

I believe you can specify your my.cnf file under your home directory.

/path/to/mysql/bin/mysqld_safe &

I haven't needed to do this, but it should work.

2

You should definitely try MySQL Sandbox :

To run a simple MySQL service in your $HOME, you just need to :

  • Download a MySQL binary tarball from MySQL's website
  • run "make_sandbox /path/to/tarball.tar.gz"

You will get a complete MySQL server running in the directory of your choice.

The full documentation is there.

1

Most probably your option would be to compile from source and setting the install directories to be in your home. And then you need to choose some port above 1024, as by default normal (non-root) users can not open ports below 1024.

0

As Sunny stated, using the normal ports will not be an option for you but it should run otherwise. For a non-root user, though, it would almost always be better to use a DB product like SQLite which is designed to be used in this way.

0

You can take the generic tar.gz/tar.bz2 binaries from the MySQL site and set at least the following options either using a my.cnf (which has to be specified with --defaults-file to mysqld) or directly as command line parameter when starting the mysqld:

--with-datadir - this configures where MySQL will store the database files
--socket       - Where to put the unix domain socket file

in a my.cnf you might also set the listen option.

Please refer to the documentation on http://dev.mysql.com/doc/refman/5.1/en/server-options.html for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .