lib/isolated_server/mysql.rb in isolated_server-0.4.9 vs lib/isolated_server/mysql.rb in isolated_server-0.4.10
- old
+ new
@@ -130,13 +130,16 @@
else
mysqld = locate_executable("mysqld")
`#{mysqld} --version` =~ /mysqld\s+Ver (5\.\d)\.\d+/
major_version = $1 || '5.5'
+ `#{mysqld} --no-defaults --verbose --help` =~ /^basedir\s+(.*)$/
+ basedir = $1
+
mysql_install_db = locate_executable("mysql_install_db")
idb_path = File.dirname(mysql_install_db)
- system("(cd #{idb_path.shellescape}/..; mysql_install_db --datadir=#{@mysql_data_dir.shellescape} --user=`whoami`) >/dev/null 2>&1")
+ system("(cd #{idb_path.shellescape}/..; mysql_install_db --datadir=#{@mysql_data_dir.shellescape} --basedir=#{basedir.shellescape} --user=`whoami`) >/dev/null 2>&1")
system("cp #{File.expand_path(File.dirname(__FILE__)).shellescape}/mysql/tables/#{major_version}/user.* #{@mysql_data_dir.shellescape}/mysql")
end
end
def setup_binlog