Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

5 Answers 5

up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.