Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
dbec143f
Commit
dbec143f
authored
11 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Change MySQL to MySQL/MariaDB in the frontend
Fix issue #6269
parent
60cba996
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/setup/controller.php
+1
-1
1 addition, 1 deletion
core/setup/controller.php
lib/private/setup/mysql.php
+6
-6
6 additions, 6 deletions
lib/private/setup/mysql.php
with
7 additions
and
7 deletions
core/setup/controller.php
+
1
−
1
View file @
dbec143f
...
...
@@ -91,7 +91,7 @@ class Controller {
$databases
[
'sqlite'
]
=
'SQLite'
;
}
if
(
$hasMySQL
)
{
$databases
[
'mysql'
]
=
'MySQL'
;
$databases
[
'mysql'
]
=
'MySQL
/MariaDB
'
;
}
if
(
$hasPostgreSQL
)
{
$databases
[
'pgsql'
]
=
'PostgreSQL'
;
...
...
This diff is collapsed.
Click to expand it.
lib/private/setup/mysql.php
+
6
−
6
View file @
dbec143f
...
...
@@ -3,13 +3,13 @@
namespace
OC\Setup
;
class
MySQL
extends
AbstractDatabase
{
public
$dbprettyname
=
'MySQL'
;
public
$dbprettyname
=
'MySQL
/MariaDB
'
;
public
function
setupDatabase
(
$username
)
{
//check if the database user has admin right
$connection
=
@
mysql_connect
(
$this
->
dbhost
,
$this
->
dbuser
,
$this
->
dbpassword
);
if
(
!
$connection
)
{
throw
new
\DatabaseSetupException
(
$this
->
trans
->
t
(
'MySQL username and/or password not valid'
),
throw
new
\DatabaseSetupException
(
$this
->
trans
->
t
(
'MySQL
/MariaDB
username and/or password not valid'
),
$this
->
trans
->
t
(
'You need to enter either an existing account or the administrator.'
));
}
$oldUser
=
\OC_Config
::
getValue
(
'dbuser'
,
false
);
...
...
@@ -82,14 +82,14 @@ class MySQL extends AbstractDatabase {
$query
=
"CREATE USER '
$name
'@'localhost' IDENTIFIED BY '
$password
'"
;
$result
=
mysql_query
(
$query
,
$connection
);
if
(
!
$result
)
{
throw
new
\DatabaseSetupException
(
$this
->
trans
->
t
(
"MySQL user '%s'@'localhost' exists already."
,
array
(
$name
)),
$this
->
trans
->
t
(
"Drop this user from MySQL"
,
array
(
$name
)));
throw
new
\DatabaseSetupException
(
$this
->
trans
->
t
(
"MySQL
/MariaDB
user '%s'@'localhost' exists already."
,
array
(
$name
)),
$this
->
trans
->
t
(
"Drop this user from MySQL
/MariaDB
"
,
array
(
$name
)));
}
$query
=
"CREATE USER '
$name
'@'%' IDENTIFIED BY '
$password
'"
;
$result
=
mysql_query
(
$query
,
$connection
);
if
(
!
$result
)
{
throw
new
\DatabaseSetupException
(
$this
->
trans
->
t
(
"MySQL user '%s'@'%%' already exists"
,
array
(
$name
)),
$this
->
trans
->
t
(
"Drop this user from MySQL."
));
throw
new
\DatabaseSetupException
(
$this
->
trans
->
t
(
"MySQL
/MariaDB
user '%s'@'%%' already exists"
,
array
(
$name
)),
$this
->
trans
->
t
(
"Drop this user from MySQL
/MariaDB
."
));
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment