Commit 9a0c1ffa authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'docs/database-info' into 'master'

Add MySQL info in install requirements

See merge request !9230
parents f802ad37 b65cd9df
# Database MySQL # Database MySQL
## Note >**Note:**
We do not recommend using MySQL due to various issues. For example, case
We do not recommend using MySQL due to various issues. For example, case [(in)sensitivity](https://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html) and [problems](https://bugs.mysql.com/bug.php?id=65830) that [suggested](https://bugs.mysql.com/bug.php?id=50909) [fixes](https://bugs.mysql.com/bug.php?id=65830) [have](https://bugs.mysql.com/bug.php?id=63164). [(in)sensitivity](https://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html)
and [problems](https://bugs.mysql.com/bug.php?id=65830) that
[suggested](https://bugs.mysql.com/bug.php?id=50909)
[fixes](https://bugs.mysql.com/bug.php?id=65830) [have](https://bugs.mysql.com/bug.php?id=63164).
## Initial database setup ## Initial database setup
# Install the database packages ```
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev # Install the database packages
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
# Ensure you have MySQL version 5.5.14 or later
mysql --version
# Pick a MySQL root password (can be anything), type it and press enter # Ensure you have MySQL version 5.5.14 or later
# Retype the MySQL root password and press enter mysql --version
# Secure your installation # Pick a MySQL root password (can be anything), type it and press enter
sudo mysql_secure_installation # Retype the MySQL root password and press enter
# Login to MySQL # Secure your installation
mysql -u root -p sudo mysql_secure_installation
# Type the MySQL root password # Login to MySQL
mysql -u root -p
# Create a user for GitLab # Type the MySQL root password
# do not type the 'mysql>', this is part of the prompt
# change $password in the command below to a real password you pick
mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password';
# Ensure you can use the InnoDB engine which is necessary to support long indexes # Create a user for GitLab
# If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off" # do not type the 'mysql>', this is part of the prompt
mysql> SET storage_engine=INNODB; # change $password in the command below to a real password you pick
mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password';
# If you have MySQL < 5.7.7 and want to enable utf8mb4 character set support with your GitLab install, you must set the following NOW: # Ensure you can use the InnoDB engine which is necessary to support long indexes
mysql> SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda, innodb_large_prefix=1; # If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off"
mysql> SET storage_engine=INNODB;
# Create the GitLab production database # If you have MySQL < 5.7.7 and want to enable utf8mb4 character set support with your GitLab install, you must set the following NOW:
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_general_ci`; mysql> SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda, innodb_large_prefix=1;
# Grant the GitLab user necessary permissions on the database # Create the GitLab production database
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES, REFERENCES ON `gitlabhq_production`.* TO 'git'@'localhost'; mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_general_ci`;
# Quit the database session # Grant the GitLab user necessary permissions on the database
mysql> \q mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES, REFERENCES ON `gitlabhq_production`.* TO 'git'@'localhost';
# Try connecting to the new database with the new user # Quit the database session
sudo -u git -H mysql -u git -p -D gitlabhq_production mysql> \q
# Type the password you replaced $password with earlier # Try connecting to the new database with the new user
sudo -u git -H mysql -u git -p -D gitlabhq_production
# You should now see a 'mysql>' prompt # Type the password you replaced $password with earlier
# Quit the database session # You should now see a 'mysql>' prompt
mysql> \q
# You are done installing the database for now and can go back to the rest of the installation. # Quit the database session
mysql> \q
```
You are done installing the database for now and can go back to the rest of the installation.
Please proceed to the rest of the installation before running through the utf8mb4 support section. Please proceed to the rest of the installation before running through the utf8mb4 support section.
### MySQL utf8mb4 support ### MySQL utf8mb4 support
After installation or upgrade, remember to [convert any new tables](#convert) to `utf8mb4`/`utf8mb4_general_ci`. After installation or upgrade, remember to [convert any new tables](#convert) to `utf8mb4`/`utf8mb4_general_ci`.
......
...@@ -15,11 +15,11 @@ For the installations options please see [the installation page on the GitLab we ...@@ -15,11 +15,11 @@ For the installations options please see [the installation page on the GitLab we
### Unsupported Unix distributions ### Unsupported Unix distributions
- OS X
- Arch Linux - Arch Linux
- Fedora - Fedora
- Gentoo
- FreeBSD - FreeBSD
- Gentoo
- macOS
On the above unsupported distributions is still possible to install GitLab yourself. On the above unsupported distributions is still possible to install GitLab yourself.
Please see the [installation from source guide](installation.md) and the [installation guides](https://about.gitlab.com/installation/) for more information. Please see the [installation from source guide](installation.md) and the [installation guides](https://about.gitlab.com/installation/) for more information.
...@@ -120,7 +120,12 @@ To change the Unicorn workers when you have the Omnibus package please see [the ...@@ -120,7 +120,12 @@ To change the Unicorn workers when you have the Omnibus package please see [the
## Database ## Database
If you want to run the database separately expect a size of about 1 MB per user. We currently support the following databases:
- PostgreSQL (recommended)
- MySQL/MariaDB
If you want to run the database separately, expect a size of about 1 MB per user.
### PostgreSQL Requirements ### PostgreSQL Requirements
...@@ -128,7 +133,9 @@ Users using PostgreSQL must ensure the `pg_trgm` extension is loaded into every ...@@ -128,7 +133,9 @@ Users using PostgreSQL must ensure the `pg_trgm` extension is loaded into every
GitLab database. This extension can be enabled (using a PostgreSQL super user) GitLab database. This extension can be enabled (using a PostgreSQL super user)
by running the following query for every database: by running the following query for every database:
CREATE EXTENSION pg_trgm; ```
CREATE EXTENSION pg_trgm;
```
On some systems you may need to install an additional package (e.g. On some systems you may need to install an additional package (e.g.
`postgresql-contrib`) for this extension to become available. `postgresql-contrib`) for this extension to become available.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment