<div dir="ltr">The proof about common mysql server database init :<div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">[root@localhost lib]# mysql
</span><br><span style="font-weight:bold;color:rgb(0,0,0)">Welcome to the MariaDB monitor.  Commands end with ; or \g.</span><span style="color:rgb(0,0,0)">
</span><br><span style="font-weight:bold;color:rgb(0,0,0)">Your MariaDB connection id is 15</span><span style="color:rgb(0,0,0)">
</span><br><span style="font-weight:bold;color:rgb(0,0,0)">Server version: 10.0.22-MariaDB Mageia MariaDB Server</span><span style="color:rgb(0,0,0)">
</span><br>
<br><span style="font-weight:bold;color:rgb(0,0,0)">Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.</span><span style="color:rgb(0,0,0)">
</span><br>
<br><span style="font-weight:bold;color:rgb(0,0,0)">Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.</span><span style="color:rgb(0,0,0)">
</span><br>
<br>MariaDB [(none)]> show databases;        <br>+--------------------+
<br>| Database           |
<br>+--------------------+
<br>| digikamdb          |
<br>| information_schema |
<br>| mysql              |
<br>| performance_schema |
<br>| test               |
<br>+--------------------+
<br><span style="font-weight:bold;color:rgb(0,0,0)">5 rows in set (0.01 sec)</span><span style="color:rgb(0,0,0)">
</span><br>
<br>MariaDB [(none)]> use digikamdb;  <br><span style="font-weight:bold;color:rgb(0,0,0)">Database changed</span><span style="color:rgb(0,0,0)">
</span><br>MariaDB [digikamdb]> show tables;           <br>+----------------------+
<br>| Tables_in_digikamdb  |
<br>+----------------------+
<br>| AlbumRoots           |
<br>| Albums               |
<br>| CustomIdentifiers    |
<br>| DownloadHistory      |
<br>| FilePaths            |
<br>| Identities           |
<br>| IdentityAttributes   |
<br>| ImageComments        |
<br>| ImageCopyright       |
<br>| ImageHaarMatrix      |
<br>| ImageHistory         |
<br>| ImageInformation     |
<br>| ImageMetadata        |
<br>| ImagePositions       |
<br>| ImageProperties      |
<br>| ImageRelations       |
<br>| ImageTagProperties   |
<br>| ImageTags            |
<br>| Images               |
<br>| OpenCVLBPHRecognizer |
<br>| OpenCVLBPHistograms  |
<br>| Searches             |
<br>| Settings             |
<br>| TagProperties        |
<br>| Tags                 |
<br>| TagsTree             |
<br>| Thumbnails           |
<br>| UniqueHashes         |
<br>| VideoMetadata        |
<br>+----------------------+
<br><span style="font-weight:bold;color:rgb(0,0,0)">29 rows in set (0.01 sec)</span><span style="color:rgb(0,0,0)">
</span><br><br>
Gilles Caulier</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-18 15:32 GMT+01:00 Gilles Caulier <span dir="ltr"><<a href="mailto:caulier.gilles@gmail.com" target="_blank">caulier.gilles@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">For the moment no. It's always easy to drop code against to write code.<div><br></div><div>As i explore and fix code, i can expect to find a solution for internal server. I will see later to drop or not.</div><div><br></div><div>Note : with this commit :</div><div><br></div><div><a href="http://commits.kde.org/digikam/74742b93f227ff4413e10cf3c8f895d452c10858" target="_blank">http://commits.kde.org/digikam/74742b93f227ff4413e10cf3c8f895d452c10858</a><br></div><div><br></div><div>We are able to setup a mysql server to host Core, Thumbs, and Face database in both case :</div><div><br></div><div>- Separated DB</div><div>- Common DB</div><div><br></div><div>The case of internal server will inherit of this fix. Without it, i'm sure that it cannot work properly.</div><div><br></div><div>So for internal server, we need to found why index procedure is problematic. As i can see the server is initialized by a mysql-global.conf config text file. I'm sure that some settings need to be adjusted here, but which one exactly, i don't know....</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Gilles Caulier</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-11-18 15:23 GMT+01:00 Henrique Santos Fernandes <span dir="ltr"><<a href="mailto:sf.rique@gmail.com" target="_blank">sf.rique@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I thought support for interval database had been  dropped! <br>
My bad</p><div><div>
<br><div class="gmail_quote"><div dir="ltr">Em qua, 18 de nov de 2015 12:19, Gilles Caulier <<a href="mailto:caulier.gilles@gmail.com" target="_blank">caulier.gilles@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Certainly, but this will not solve the problem with internal server solution, because in this case there is no way to tune table creation from mysql prompt... All is done in background by digiKam database server (i don't yet investigate in this code).</div><div dir="ltr"><div><br></div><div>Gilles</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-18 14:56 GMT+01:00 Henrique Santos Fernandes <span dir="ltr"><<a href="mailto:sf.rique@gmail.com" target="_blank">sf.rique@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div><div><div dir="ltr">Em qua, 18 de nov de 2015 às 11:46, Gilles Caulier <<a href="mailto:caulier.gilles@gmail.com" target="_blank">caulier.gilles@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-11-18 14:33 GMT+01:00 Henrique Santos Fernandes <span dir="ltr"><<a href="mailto:sf.rique@gmail.com" target="_blank">sf.rique@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I dont understando that much but i have 2 questions.<div><br></div><div>Why dont create the index normaly instead of using this if exist procedure?</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I don't know. I don't write the SQL code for MySQL. This have been done by an old contributor, few years ago...</div><div><br></div><div>If you look into this procedure code, it's sound complicated. I don't know why ?</div><div><br></div><div><div>CREATE PROCEDURE create_index_if_not_exists(table_name_vc varchar(50), index_name_vc varchar(50), field_list_vc varchar(1024))</div><div>                    BEGIN</div><div><br></div><div>                    set @Index_cnt = (</div><div>                        SELECT COUNT(1) cnt</div><div>                        FROM INFORMATION_SCHEMA.STATISTICS</div><div>                        WHERE CONVERT(DATABASE() USING latin1) = CONVERT(TABLE_SCHEMA USING latin1)</div><div>                        AND CONVERT(table_name USING latin1) = CONVERT(table_name_vc USING latin1)</div><div>                        AND CONVERT(index_name USING latin1) = CONVERT(index_name_vc USING latin1)</div><div>                    );</div><div><br></div><div>                    IF IFNULL(@Index_cnt, 0) = 0 THEN</div><div>                        set @index_sql = CONCAT( </div><div>                            CONVERT( 'ALTER TABLE ' USING latin1),</div><div>                            CONVERT( table_name_vc USING latin1),</div><div>                            CONVERT( ' ADD INDEX ' USING latin1),</div><div>                            CONVERT( index_name_vc USING latin1),</div><div>                            CONVERT( '(' USING latin1),</div><div>                            CONVERT( field_list_vc USING latin1),</div><div>                            CONVERT( ');' USING latin1)</div><div>                        );</div><div>                        PREPARE stmt FROM @index_sql;</div><div>                        EXECUTE stmt;</div><div>                        DEALLOCATE PREPARE stmt;</div><div>                    END IF;</div><div>                    END;</div></div><div><br></div><div>Calls of this procedure is done like this (for thumbnails DB for ex) :</div><div><br></div><div>CALL create_index_if_not_exists('UniqueHashes','id_uniqueHashes','thumbId');<br></div><div>CALL create_index_if_not_exists('FilePaths','id_filePaths','thumbId');<br></div><div>CALL create_index_if_not_exists('CustomIdentifiers','id_customIdentifiers','thumbId');<br></div><div><br></div><div>Why this complexity with this procedure. No idea...</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>If the procedure is really needed, you need to create it with digikam user?</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>it's already the case with current code.</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>You should be able to create the procedure when seting up the databases, grant privilges and stuff. right?</div><div> <br></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div></div><div>So user digikam dont need to create the procedure right? the root/admin could do this..</div><div><br></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>That i can see on Internet, procedure and function need Mysql grant priviledges to be executed, not created... But i'm not an expert...<br></div></div></div></div></div></blockquote><div><br></div></div></div><div>Can you try the explained ins thsi link and see if you have permissiosn?</div><div><a href="http://stackoverflow.com/questions/10089308/mysql-stored-procedure-permissions" target="_blank">http://stackoverflow.com/questions/10089308/mysql-stored-procedure-permissions</a><br></div><div><br></div><div>I guess it would be somethng like this:</div><div><pre style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">GRANT</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">EXECUTE</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">ON</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">PROCEDURE</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> digikamthumbsdb</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span style="color:rgb(33,33,33);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;white-space:normal;background-color:rgb(255,255,255)">create_index_if_not_exists</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">TO</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'digikam'</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">@</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'localhost'</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">;</span></code></pre></div><div>Read the comments, because the user said it needed to add something in this query!</div><div><br></div><div>You may add to all procedures as well..</div><div><a href="http://dba.stackexchange.com/questions/20221/mysql-user-permission-on-stored-procedure" target="_blank">http://dba.stackexchange.com/questions/20221/mysql-user-permission-on-stored-procedure</a><br></div><div><br></div><div>Hope this help!</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div></div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Gilles Caulier</div></div></div></div>
_______________________________________________<br>
Digikam-users mailing list<br>
<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-users" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/digikam-users</a><br>
</blockquote></span></div></div>
<br>_______________________________________________<br>
Digikam-users mailing list<br>
<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-users" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/digikam-users</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>
Digikam-users mailing list<br>
<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-users" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/digikam-users</a><br>
</blockquote></div>
</div></div><br>_______________________________________________<br>
Digikam-users mailing list<br>
<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-users" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/digikam-users</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>