views:

68

answers:

2

Hi,

If I want to be able to test my application against a empty MySQL database each time my application's testsuite is run, how can I start up a server as a non-root user which refers to a empty (not saved anywhere, or in saved to /tmp) MySQL database?

My application is in Python, and I'm using unittest on Ubuntu 9.10.

+1  A: 

--datadir for just the data or --basedir

jspcal
the full command I ended up wanting to run was:mysqld --no-defaults --datadir $SOME_TEMP_DIR --socket mysql.socket --skip-grant
lfaraone
You might also want to add --skip-networking or make sure you set the --port to something else than 3306. Just to make sure.Putting these in option file is also good: mysqld --defaults-file=my_testsuite.cnf (it will ignore the other option files)
geertjanvdk
A: 

You can try the Blackhole and Memory table types in MySQL.

Alix Axel
IMHO, if you are testing your application, it's better to use the storage engine which it will use later.
geertjanvdk
@geertjanvdk: Sure, I just posted my question since I didn't knew any other option... We are always learning! =)
Alix Axel