<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>selfoss support forum - PDOStatement: SUPER privilege?</title>
<link>https://forum.selfoss.aditu.de/</link>
<description>selfoss support forum</description>
<language>en</language>
<item>
<title>PDOStatement: SUPER privilege? (reply)</title>
<content:encoded><![CDATA[<p>Depending on mysql version, even the user executing the trigger does need SUPER privileges...</p>
<p>This is what I did (somewhat kludgy, but I'm no expert on this):</p>
<ul>
<li>I gave my selfoss mysql user SUPER privileges to run the database update, and revoked them afterwards.<br />
</li><li>exported the triggers with something like <em>mysqldump --triggers --no-create-info --no-data --no-create-db --skip-opt selfoss &gt; selfoss.trigger</em><br />
</li><li>deleted the triggers from the selfoss database: <em>drop trigger insert_updatetime_trigger;</em> and <em>drop trigger update_updatetime_trigger;</em><br />
</li><li> replaced the selfoss user in the exported selfoss.trigger file with root (<em>DEFINER=`root`@`localhost`</em>)<br />
</li><li> <em>mysql selfoss &lt; selfoss.trigger</em></li></ul><p>So I now have the triggers running as root, but selfoss accesses the database with an unprivileged user.</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=1078</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=1078</guid>
<pubDate>Thu, 14 May 2015 21:19:49 +0000</pubDate>
<dc:creator>AlexB</dc:creator>
</item>
<item>
<title>PDOStatement: SUPER privilege? (reply)</title>
<content:encoded><![CDATA[<p>I guess I'm having a conversation with myself here...</p>
<p><strong>Update:</strong> This post is wrong. If executed from the command-line, I need to change the delimiter first, so the command-line parser does not barf on the ; contained in the trigger. That is not necessary when executed through PHP. So this particular error is not relevant to my original problem.</p>
<p>About that trigger:</p>
<p>CREATE TRIGGER insert_updatetime_trigger<br />
BEFORE INSERT ON items FOR EACH ROW<br />
BEGIN<br />
SET NEW.updatetime = NOW();<br />
END</p>
<p>Just found out that attempting to create that trigger manually produces a:</p>
<p>ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 (very helpful, I should say)</p>
<p>Database is: mysql Ver 15.1 Distrib 10.0.12-MariaDB</p>
<p>Anybody know more about triggers than I do with an idea what the problem might be here?</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=897</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=897</guid>
<pubDate>Thu, 07 Aug 2014 17:54:54 +0000</pubDate>
<dc:creator>jernst</dc:creator>
</item>
<item>
<title>PDOStatement: SUPER privilege? (reply)</title>
<content:encoded><![CDATA[<p>Turns out I only get this message on the very first access of the new install with a browser. As soon as I hit refresh, the front page shows as if nothing had ever happened.</p>
<p>I decided to switch on the MySQL query log. It appears that on the first HTTP GET, these two statements are executed:</p>
<p>140807 17:34:59  1809 Connect   CN0BmDJEQRRQkElB@localhost as anonymous on ghtqrcnshudgzeyu<br />
                 1809 Query     SET NAMES utf8<br />
                 1809 Query     SHOW TABLES<br />
                 1809 Query     CREATE TABLE items (<br />
                        id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,<br />
                        datetime DATETIME NOT NULL ,<br />
                        title TEXT NOT NULL ,<br />
                        content LONGTEXT NOT NULL ,<br />
                        thumbnail TEXT ,<br />
                        icon TEXT ,<br />
                        unread BOOL NOT NULL ,<br />
                        starred BOOL NOT NULL ,<br />
                        source INT NOT NULL ,<br />
                        uid VARCHAR(255) NOT NULL,<br />
                        link TEXT NOT NULL,<br />
                        updatetime DATETIME NOT NULL,<br />
                        INDEX (source)<br />
                    ) ENGINE = MYISAM DEFAULT CHARSET=utf8<br />
140807 17:35:00  1809 Query     CREATE TRIGGER insert_updatetime_trigger<br />
                    BEFORE INSERT ON items FOR EACH ROW<br />
                        BEGIN<br />
                            SET NEW.updatetime = NOW();<br />
                        END<br />
                 1809 Quit</p>
<p>while on the second HTTP GET, tables sources, version, tags are created. So chances are that Selfoss on MySQL (actually MariaDB in my case) aren't seeing eye to eye on the CREATE TRIGGER statement. Indeed, SHOW TRIGGERS does not show anything.</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=896</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=896</guid>
<pubDate>Thu, 07 Aug 2014 17:41:54 +0000</pubDate>
<dc:creator>jernst</dc:creator>
</item>
<item>
<title>PDOStatement: SUPER privilege?</title>
<content:encoded><![CDATA[<p>I'm getting an HTTP 500 error, and this message:<br />
    PDOStatement: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)</p>
<p>Looking up the SUPER privilege, it seems that my selfoss user really shouldn't have it. Conversely, I do like to keep binary logging for recovery purposes.</p>
<p>I'm unclear just what the reason is that I have to make this choice?</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=895</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=895</guid>
<pubDate>Tue, 05 Aug 2014 22:04:07 +0000</pubDate>
<dc:creator>jernst</dc:creator>
</item>
</channel>
</rss>
