summaryrefslogtreecommitdiff
path: root/rhnop-server
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-03-11 14:47:05 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-03-11 14:47:05 (GMT)
commit22a221190e7a81ca3b32578ee19c0a8503be957f (patch)
tree7c242da3923b7922914ab7a2cd038b9e6b6d5efb /rhnop-server
parent6bda8cc7758a9b30bcaf3ef9d9d4fda1eaf23e64 (diff)
setting mysql to utf-8
Diffstat (limited to 'rhnop-server')
-rw-r--r--rhnop-server/playlog.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/rhnop-server/playlog.lua b/rhnop-server/playlog.lua
index d6f1987..97ee4cf 100644
--- a/rhnop-server/playlog.lua
+++ b/rhnop-server/playlog.lua
@@ -21,11 +21,12 @@
luasql = require "luasql.mysql"
--- CREATE DATABASE rhnop
+-- CREATE DATABASE rhnop CHARACTER SET utf8 COLLATE utf8_unicode_ci;
-- GRANT select,insert,update ON rhnop.* TO 'nopsyncd' IDENTIFIED BY '<password>';
-- GRANT select ON rhnop.* TO 'nopcollectd' IDENTIFIED BY '<password>';
-- USE rhnop
-- CREATE TABLE IF NOT EXISTS now (timestamp BIGINT UNSIGNED PRIMARY KEY NOT NULL, cart INT NOT NULL, len INT, showtitle VARCHAR(255), title VARCHAR(255), artist VARCHAR(255), album VARCHAR(255), ismusic BOOLEAN);
+-- ALTER TABLE now CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
conf = require "conf"
@@ -44,7 +45,12 @@ function playlog:init()
return nil, err
end
- local ret, err = self.con:setautocommit(true)
+ local ret, err = self.con:execute("SET CHARACTER SET utf8")
+ if ret == nil then
+ return nil, err
+ end
+
+ ret, err = self.con:setautocommit(true)
if ret == nil then
return nil, err
end