File: FindMySQLhome.R

package info (click to toggle)
rmysql 0.7-5-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 708 kB
  • ctags: 276
  • sloc: ansic: 2,719; makefile: 4
file content (16 lines) | stat: -rwxr-xr-x 569 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require(utils,quietly=TRUE)
# Find first existing Mysql home 
reg <- readRegistry("SOFTWARE\\MySQL AB", hive="HLM", maxdepth=2)
if (!is.null(reg)){
	cat("Try setting MYSQL_HOME to one of the following (you may have to use the non-8dot3 file name):\r\n\r\n")
	invisible(lapply(reg,function(i){
		MySQLhome <- file.path(i$Location,".")
		if (utils::file_test("-d",MySQLhome) &&
			utils::file_test("-d",file.path(MySQLhome,"include")) &&
			utils::file_test("-d",file.path(MySQLhome,"lib/opt"))){
			cat(MySQLhome,"\r\n",sep='')
		}
	}
	))
}
q(save="no")