Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b0a82995
Commit
b0a82995
authored
May 19, 2019
by
Evan Read
Committed by
Achilleas Pipinellis
May 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit MySQL services page
parent
7e14fc25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
doc/ci/services/mysql.md
doc/ci/services/mysql.md
+11
-14
No files found.
doc/ci/services/mysql.md
View file @
b0a82995
...
@@ -18,7 +18,7 @@ services:
...
@@ -18,7 +18,7 @@ services:
variables
:
variables
:
# Configure mysql environment variables (https://hub.docker.com/_/mysql/)
# Configure mysql environment variables (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE
:
"
<your_mysql_database>"
MYSQL_DATABASE
:
"
<your_mysql_database>"
MYSQL_ROOT_PASSWORD
:
"
mysql_strong_password
"
MYSQL_ROOT_PASSWORD
:
"
<your_mysql_password>
"
```
```
And then configure your application to use the database, for example:
And then configure your application to use the database, for example:
...
@@ -26,18 +26,18 @@ And then configure your application to use the database, for example:
...
@@ -26,18 +26,18 @@ And then configure your application to use the database, for example:
```
yaml
```
yaml
Host
:
mysql
Host
:
mysql
User
:
root
User
:
root
Password
:
mysql_strong_password
Password
:
<your_mysql_password>
Database
:
el_duderino
Database
:
<your_mysql_database>
```
```
If you are wondering why we used
`mysql`
for the
`Host`
, read more at
If you are wondering why we used
`mysql`
for the
`Host`
, read more at
[
How services are linked to the job
](
../docker/using_docker_images.md#how-services-are-linked-to-the-job
)
.
[
How services are linked to the job
](
../docker/using_docker_images.md#how-services-are-linked-to-the-job
)
.
You can also use any other docker image available on
[
Docker Hub
]
[
hub-mysql
]
.
You can also use any other docker image available on
[
Docker Hub
]
(
https://hub.docker.com/_/mysql/
)
.
For example, to use MySQL 5.5 the service becomes
`mysql:5.5`
.
For example, to use MySQL 5.5 the service becomes
`mysql:5.5`
.
The
`mysql`
image can accept some environment variables. For more details
The
`mysql`
image can accept some environment variables. For more details
check the documentation on
[
Docker Hub
]
[
hub-mysql
]
.
check the documentation on
[
Docker Hub
]
(
https://hub.docker.com/_/mysql/
)
.
## Use MySQL with the Shell executor
## Use MySQL with the Shell executor
...
@@ -74,13 +74,13 @@ mysql> CREATE USER 'runner'@'localhost' IDENTIFIED BY '$password';
...
@@ -74,13 +74,13 @@ mysql> CREATE USER 'runner'@'localhost' IDENTIFIED BY '$password';
Create the database:
Create the database:
```
bash
```
bash
mysql> CREATE DATABASE IF NOT EXISTS
`
el_duderino
`
DEFAULT CHARACTER SET
`
utf8
`
COLLATE
`
utf8_unicode_ci
`
;
mysql> CREATE DATABASE IF NOT EXISTS
`
<your_mysql_database>
`
DEFAULT CHARACTER SET
`
utf8
`
COLLATE
`
utf8_unicode_ci
`
;
```
```
Grant the necessary permissions on the database:
Grant the necessary permissions on the database:
```
bash
```
bash
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES ON
`
el_duderino
`
.
*
TO
'runner'
@
'localhost'
;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES ON
`
<your_mysql_database>
`
.
*
TO
'runner'
@
'localhost'
;
```
```
If all went well you can now quit the database session:
If all went well you can now quit the database session:
...
@@ -93,7 +93,7 @@ Now, try to connect to the newly created database to check that everything is
...
@@ -93,7 +93,7 @@ Now, try to connect to the newly created database to check that everything is
in place:
in place:
```
bash
```
bash
mysql
-u
runner
-p
-D
el_duderino
mysql
-u
runner
-p
-D
<your_mysql_database>
```
```
As a final step, configure your application to use the database, for example:
As a final step, configure your application to use the database, for example:
...
@@ -102,17 +102,14 @@ As a final step, configure your application to use the database, for example:
...
@@ -102,17 +102,14 @@ As a final step, configure your application to use the database, for example:
Host: localhost
Host: localhost
User: runner
User: runner
Password:
$password
Password:
$password
Database:
el_duderino
Database:
<your_mysql_database>
```
```
## Example project
## Example project
We have set up an
[
Example MySQL Project
]
[
mysql-example-repo
]
for your
We have set up an
[
Example MySQL Project
]
(
https://gitlab.com/gitlab-examples/mysql
)
for your
convenience that runs on
[
GitLab.com
](
https://gitlab.com
)
using our publicly
convenience that runs on
[
GitLab.com
](
https://gitlab.com
)
using our publicly
available
[
shared runners
](
../runners/README.md
)
.
available
[
shared runners
](
../runners/README.md
)
.
Want to hack on it? Simply fork it, commit and push
your changes. Within a few
Want to hack on it? Simply fork it, commit and push your changes. Within a few
moments the changes will be picked by a public runner and the job will begin.
moments the changes will be picked by a public runner and the job will begin.
[
hub-mysql
]:
https://hub.docker.com/_/mysql/
[
mysql-example-repo
]:
https://gitlab.com/gitlab-examples/mysql
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment