[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [digikam] libs/database/utils: Change MySQL initialization commands for remote server
From:       Swati Lodha <swatilodha27 () gmail ! com>
Date:       2016-06-30 20:02:23
Message-ID: E1bIiAJ-000279-Um () code ! kde ! org
[Download RAW message or body]

Git commit 7cf00536e50cacb55310659344ddaf5b6ff5e1fe by Swati Lodha.
Committed on 30/06/2016 at 20:00.
Pushed by swatil into branch 'master'.

Change MySQL initialization commands for remote server

M  +7    -4    libs/database/utils/dbsettingswidget.cpp

http://commits.kde.org/digikam/7cf00536e50cacb55310659344ddaf5b6ff5e1fe

diff --git a/libs/database/utils/dbsettingswidget.cpp \
b/libs/database/utils/dbsettingswidget.cpp index 7d3ed27..e10e382 100644
--- a/libs/database/utils/dbsettingswidget.cpp
+++ b/libs/database/utils/dbsettingswidget.cpp
@@ -557,11 +557,14 @@ void DatabaseSettingsWidget::handleInternalServer(int index)
 
 void DatabaseSettingsWidget::slotUpdateSqlInit()
 {
-    QString sql = QString::fromLatin1("GRANT USAGE ON *.* TO \'%1\'@\'localhost\' \
IDENTIFIED BY \'<b>password</b>\';<br>") +    QString sql = \
QString::fromLatin1("CREATE USER \'%1\'@\'%\' IDENTIFIED BY \
\'<b>password</b>\';<br>") +                                      \
.arg(d->userName->text()); +                                      
+    sql += QString::fromLatin1("GRANT ALL ON *.* TO \'%1\'@\'%\' IDENTIFIED BY \
                \'<b>password</b>\';<br>")
                                       .arg(d->userName->text());
 
     sql += QString::fromLatin1("CREATE DATABASE %1;<br>"
-                               "GRANT ALL PRIVILEGES ON %2.* TO \
\'%3\'@\'localhost\';<br>") +                               "GRANT ALL PRIVILEGES ON \
                %2.* TO \'%3\'@\'%\';<br>")
                                       .arg(d->dbNameCore->text())
                                       .arg(d->dbNameCore->text())
                                       .arg(d->userName->text());
@@ -569,7 +572,7 @@ void DatabaseSettingsWidget::slotUpdateSqlInit()
     if (d->dbNameThumbs->text() != d->dbNameCore->text())
     {
         sql += QString::fromLatin1("CREATE DATABASE %1;<br>"
-                                   "GRANT ALL PRIVILEGES ON %2.* TO \
\'%3\'@\'localhost\';<br>") +                                   "GRANT ALL PRIVILEGES \
                ON %2.* TO \'%3\'@\'%\';<br>")
                                    .arg(d->dbNameThumbs->text())
                                    .arg(d->dbNameThumbs->text())
                                    .arg(d->userName->text());
@@ -579,7 +582,7 @@ void DatabaseSettingsWidget::slotUpdateSqlInit()
         (d->dbNameFace->text() != d->dbNameThumbs->text()))
     {
         sql += QString::fromLatin1("CREATE DATABASE %1;<br>"
-                                   "GRANT ALL PRIVILEGES ON %2.* TO \
\'%3\'@\'localhost\';<br>") +                                   "GRANT ALL PRIVILEGES \
                ON %2.* TO \'%3\'@\'%\';<br>")
                                    .arg(d->dbNameFace->text())
                                    .arg(d->dbNameFace->text())
                                    .arg(d->userName->text());


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic