diff options
author | Stan Hu <stanhu@gmail.com> | 2017-11-09 23:18:26 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-11-10 09:14:03 +0300 |
commit | 8efdf75bcb3621822523803b02bd308792bf84d5 (patch) | |
tree | b32a37e124f7f5ae1b329a30dac1caf8ea4d0a1d /scripts/create_mysql_user.sh | |
parent | 304ceb144cca36dbcefcfb508b0dac220f76c9e1 (diff) |
Use a non-superuser user to access GitLab to ensure permissions are proper
We have run into permission issues with MySQL triggers in #36633 that
would have been caught earlier either if our migration tests or GitLab QA
tests had been testing against non-superuser users. This change creates
a non-superuser that has access to the GitLab test database and uses that.
Closes #39932
Diffstat (limited to 'scripts/create_mysql_user.sh')
-rw-r--r-- | scripts/create_mysql_user.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/create_mysql_user.sh b/scripts/create_mysql_user.sh new file mode 100644 index 00000000000..28f6cfb50ae --- /dev/null +++ b/scripts/create_mysql_user.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +mysql --user=root --host=mysql <<EOF +CREATE DATABASE IF NOT EXISTS gitlabhq_test; +CREATE USER IF NOT EXISTS 'gitlab'@'%'; +GRANT ALL PRIVILEGES ON gitlabhq_test.* TO 'gitlab'@'%'; +FLUSH PRIVILEGES; +EOF |