Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

GitLab ce community version modified to mysql configuration (yum)

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Replace Gitlab database with mysql database

Note: I only succeeded in the 8.9.9 version of the experiment, because this 8.9.9 can be Chinese, the latest modification of mysql according to this method has a problem, see the comments, there is a netizen installed the latest.

Install Mysql first. I'm testing it here, so I installed 5.6with Yum.

Edit yum.repo

[mysql56-community]

Name=MySQL 5.6Community Server

Baseurl= http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/

Enabled=1

Gpgcheck=0

Run directly after saving

Yum install mysql-community-server-y installation

The installation is complete.

/ etc/init.d/mysqld start starts mysql

Mysql_secure_installation initialization

Mysql-u root-p connection

CREATE DATABASE gitlab DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; creates a library gitlab

Grant all privileges on gitlab.* to gitlab@ "%" identified by 'gitlab123' withgrant option; establishes a connection to the user

Flush privileges; refresh

First install the mysql2 package, which is used by ruby to connect to the database.

Cd / opt/gitlab/embedded/bin/

. / gem install-i/opt/gitlab/embedded/service/gem/ruby/2.1.0 mysql2

There is an error that requires installing the mysql-devel package

Yum install mysql-devel-y install it

Then the configuration is modified.

Vi / opt/gitlab/embedded/service/gitlab-rails/.bundle/config

Vi/etc/gitlab/gitlab.rb

Postgresql ['enable'] = false

Gitlab_rails ['db_adapter'] = "mysql2"

Gitlab_rails ['db_encoding'] = "utf8"

Gitlab_rails ['db_database'] = "gitlab"

Gitlab_rails ['db_pool'] = 10

Gitlab_rails ['db_username'] = "gitlab"

Gitlab_rails ['db_password'] = "gitlab123"

Gitlab_rails ['db_host'] = "127.0.0.1"

Gitlab_rails ['db_port'] = 3306

The configuration is modified.

Gitlab-rakegitlab:check performs a check

Wrong report?

Cd / opt/gitlab/embedded/bin/

. / gem install-i/opt/gitlab/embedded/service/gem/ruby/2.1.0 mysql2-v "0.3.20" execute this to install 0.3.20 as well.

Gitlab-rake gitlab:check check again: error again

Gitlab-ctl reconfigure runs this to make our modified gitlab.rb file effective

Gitlab-rake gitlab:check retest:

Gitlab-rake gitlab:setup creates new content in db and sets the administrator account

Enter yes (this will create the necessary database tables and generate the database.

You will lose any previous data stored in the database.)

After entering yes

Retest: gitlab-rake gitlab:check

Restarted the service

Gitlab-ctl stop

Gitlab-ctl start

I still reported an error after reboot. I've been looking for it for a long time.

Sudo chmod-Rug+rwX,o-rwx / var/opt/gitlab/git-data/repositories

Chmod-R ug-s/var/opt/gitlab/git-data/repositories

Find/var/opt/gitlab/git-data/repositories-type d-print0 | sudo xargs-0 chmod gears

After executing the above three commands, the permissions do not seem to be correct.

The good states are as follows:

Then revisit will be the same as our newly installed gitlab. You need to re-enter the setting password.

Create a git client to take a look:

# mkdir test2 # cd test2 # git clone https://192.168.61.129/root/test.git # ls # cd test/ # ls # touch test.txt # vi test.txt # git status # git commit-m "test" # git push-u origin master

Check the available data:

Finally, I'll test it again:

Gitlab-rake gitlab:check

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report