Advertisement
nrzi

mysql access fails when compiled but not when 'runghc'ed

Apr 13th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Database.HDBC
  2. import Database.HDBC.MySQL as MySQL
  3.  
  4. connectDatabase :: IO MySQL.Connection
  5. connectDatabase = connectMySQL defaultMySQLConnectInfo
  6.                   { mysqlHost = "127.0.0.1" , mysqlUser = "root", mysqlPassword = "root", mysqlDatabase = "k2x", mysqlPort = 3306, mysqlUnixSocket = "" }
  7.  
  8. main = do
  9.     nativeconn <- connectDatabase
  10.     -- tables <- quickQuery' nativeconn "show tables" []
  11.     rows <- run nativeconn "CREATE OR REPLACE VIEW user_usergroup_map AS SELECT * FROM adz2h_user_usergroup_map" []
  12.     return ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement