his command probably didnt evaluate the identifier. And you wouldn't use $dir, you want the file.

Thsi requries mysql.dll to be in the same directory as mirc.exe. Please make sure mIRC.ini is in the same directory as well.

mysql.dll requires the libmysql.dll in the same directory as well. This is what I use to start up my sql db with mIRC.


Code:
alias start_sql {
  set %label user
  set %host localhost
  set %user root
  set %pass $null
  set %database user
  mysql_connect | .timermysql_dc 0 90 /mysql_dc
}

alias mysql_connect {
  var %ln = $dll(mysql.dll,Connect,%label -hud %host %user %database)
  if ($gettok(%ln,1,32) == 0) {
   echo 4 -st MySQL Connect Error: %ln
  }
  else {
    echo 12 -st MySQL connected
    if (!$timer(mysql_dc)) mysql_dc
  }
}
alias mysql_dc {
  if (!$timer(mysql_dc)) .timermysql_dc 0 90 /mysql_dc
  if ($dll(mysql.dll,Labels,1) == 1) mysql_connect
}