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 =3D QString::fromLatin1("GRANT USAGE ON *.* TO \'%1\'@\'lo=
calhost\' IDENTIFIED BY \'password\';
")
+ QString sql =3D QString::fromLatin1("CREATE USER \'%1\'@\'%\' IDENTIFI=
ED BY \'password\';
")
+ .arg(d->userName->text());
+ =
+ sql +=3D QString::fromLatin1("GRANT ALL ON *.* TO \'%1\'@\'%\' IDENTIF=
IED BY \'password\';
")
.arg(d->userName->text());
=
sql +=3D QString::fromLatin1("CREATE DATABASE %1;
"
- "GRANT ALL PRIVILEGES ON %2.* TO \'%3\'@\'l=
ocalhost\';
")
+ "GRANT ALL PRIVILEGES ON %2.* TO \'%3\'@\'%=
\';
")
.arg(d->dbNameCore->text())
.arg(d->dbNameCore->text())
.arg(d->userName->text());
@@ -569,7 +572,7 @@ void DatabaseSettingsWidget::slotUpdateSqlInit()
if (d->dbNameThumbs->text() !=3D d->dbNameCore->text())
{
sql +=3D QString::fromLatin1("CREATE DATABASE %1;
"
- "GRANT ALL PRIVILEGES ON %2.* TO \'%3\'=
@\'localhost\';
")
+ "GRANT ALL PRIVILEGES ON %2.* TO \'%3\'=
@\'%\';
")
.arg(d->dbNameThumbs->text())
.arg(d->dbNameThumbs->text())
.arg(d->userName->text());
@@ -579,7 +582,7 @@ void DatabaseSettingsWidget::slotUpdateSqlInit()
(d->dbNameFace->text() !=3D d->dbNameThumbs->text()))
{
sql +=3D QString::fromLatin1("CREATE DATABASE %1;
"
- "GRANT ALL PRIVILEGES ON %2.* TO \'%3\'=
@\'localhost\';
")
+ "GRANT ALL PRIVILEGES ON %2.* TO \'%3\'=
@\'%\';
")
.arg(d->dbNameFace->text())
.arg(d->dbNameFace->text())
.arg(d->userName->text());