gitlab-org--gitlab-foss/scripts/create_mysql_user.sh
Stan Hu 8efdf75bcb 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
2017-11-09 22:14:03 -08:00

8 lines
214 B
Bash

#!/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