Add MySQL info in install requirements

[ci skip]
This commit is contained in:
Achilleas Pipinellis 2017-02-14 16:07:46 +01:00
parent 42ad07c680
commit b65cd9df58
2 changed files with 52 additions and 42 deletions

View file

@ -1,64 +1,67 @@
# 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 # Ensure you have MySQL version 5.5.14 or later
mysql --version mysql --version
# Pick a MySQL root password (can be anything), type it and press enter # Pick a MySQL root password (can be anything), type it and press enter
# Retype the MySQL root password and press enter # Retype the MySQL root password and press enter
# Secure your installation # Secure your installation
sudo mysql_secure_installation sudo mysql_secure_installation
# Login to MySQL # Login to MySQL
mysql -u root -p mysql -u root -p
# Type the MySQL root password # Type the MySQL root password
# Create a user for GitLab # Create a user for GitLab
# do not type the 'mysql>', this is part of the prompt # do not type the 'mysql>', this is part of the prompt
# change $password in the command below to a real password you pick # change $password in the command below to a real password you pick
mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password';
# Ensure you can use the InnoDB engine which is necessary to support long indexes # Ensure you can use the InnoDB engine which is necessary to support long indexes
# If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off" # 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; mysql> SET storage_engine=INNODB;
# 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: # 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> SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda, innodb_large_prefix=1; mysql> SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda, innodb_large_prefix=1;
# Create the GitLab production database # Create the GitLab production database
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_general_ci`; mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_general_ci`;
# Grant the GitLab user necessary permissions on the database # Grant the GitLab user necessary permissions on the database
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES, REFERENCES ON `gitlabhq_production`.* TO 'git'@'localhost'; mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES, REFERENCES ON `gitlabhq_production`.* TO 'git'@'localhost';
# Quit the database session # Quit the database session
mysql> \q mysql> \q
# Try connecting to the new database with the new user # Try connecting to the new database with the new user
sudo -u git -H mysql -u git -p -D gitlabhq_production sudo -u git -H mysql -u git -p -D gitlabhq_production
# Type the password you replaced $password with earlier # Type the password you replaced $password with earlier
# You should now see a 'mysql>' prompt # You should now see a 'mysql>' prompt
# Quit the database session # Quit the database session
mysql> \q mysql> \q
```
# You are done installing the database for now and can go back to the rest of the installation.
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`.

View file

@ -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
## 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
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.