Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand DB support for MySQL #6534

Open
rschramm opened this issue Dec 13, 2018 · 15 comments
Open

Expand DB support for MySQL #6534

rschramm opened this issue Dec 13, 2018 · 15 comments
Assignees
Labels
area/database kind/requirement New feature or idea on top of harbor

Comments

@rschramm
Copy link

Hi,

I am running harbor in Docker version 18.09.0, build 4d60db4 on Ubuntu 18.04. I have pulled the latest version and got it set up and running fine with the default postgres. Now I want to change it to use mysql.

I created a new container for mysql running on 3306:33006 and I can access it from the host shell. I have used mysql workbench to migrate the registry database and have it loaded in mysql.

I have updated my harbor.cfg file as such:

#######Harbor DB configuration section#######

#The address of the Harbor database. Only need to change when using external db.
db_host = 192.168.222.79

#The password for the root user of Harbor DB. Change this before any production use.
db_password = mypassword

#The port of Harbor database host
db_port = 3306

#The user name of Harbor database
db_user = root

End of Harbor DB configuration#######

and then ran "prepare"

I deleted my /data/database directory

I have set up my adminserver/env file as such:

DATABASE_TYPE=mysql
MYSQL_HOST=$db_host
MYSQL_PORT=$db_port
MYSQL_USERNAME=$db_user
MYSQL_PASSWORD=$db_password
MYSQL_DATABASE=registry
MYSQL_PORT=$db_port
RESET=true

When I start the server with docker-compose, I get the following in the adminserver log:

Dec 13 15:48:19 172.21.0.1 adminserver[1175]: 2018-12-13T20:48:19Z [INFO] initializing system configurations...
Dec 13 15:48:19 172.21.0.1 adminserver[1175]: 2018-12-13T20:48:19Z [FATAL] [main.go:46]: failed to initialize the system: invalid database: mysql

Any help here would be appreciated...

Thanks,

Rich

@ywk253100
Copy link
Contributor

Harbor only supports PostgreSQL currently due to the limitation of the upstream repository.

@rschramm
Copy link
Author

Is this a recent change? I researched this before I began and there were several, albeit incomplete, postings about setting up harbor with MySQL. If this can ONLY work with PostgreSQL, it probably should be stated in the docs about using external databases. What's the point of DATABASE_TYPE in the env file?

@ywk253100
Copy link
Contributor

The change is introduced in version 1.6.0, and the DATABASE_TYPE is for extensibility, but it only supports PostgreSQL currently.

@reasonerjt reasonerjt added kind/requirement New feature or idea on top of harbor and removed request/feature labels Dec 26, 2018
@reasonerjt
Copy link
Contributor

After switching to pgSQL, there're some discussion to provide a abstraction layer and make Harbor DB adaptable to different DB, incl. pg, mysql

But I don't think it's gonna happen in near future.

@xaleeks xaleeks changed the title Configure Harbor to use MySQL Expand DB support for MySQL Sep 17, 2019
@xaleeks
Copy link
Contributor

xaleeks commented Sep 17, 2019

A lot of users are stuck on an older version due to lack of support for mysql, they don't have a HA solution around pgsql. Especially lots of users in China. Good idea to consider pluggable DB solution.

@xaleeks xaleeks self-assigned this Sep 17, 2019
@WSLUser
Copy link

WSLUser commented Sep 17, 2019

Other DBs to consider:

  • MSSQL
  • NOSQL, by extension Cassandra, which depends on NOSQL.
  • MongoDB (this one may not be possible)

@josesimon
Copy link

josesimon commented Nov 22, 2019

I am blocked because of this issue. Could you provide more details regarding the roadmap? Thanks

@Hokwang
Copy link

Hokwang commented Feb 18, 2020

I think mysql or mariadb is preferred, different thinking with @WSLUser.

@Iverson-lena
Copy link

Whether the support of MySQL database has been considered? This ability is urgently needed.

@guanxingfeng
Copy link

Also very much looking forward to supporting mysql or mariadb.

@kfirfer
Copy link

kfirfer commented Oct 3, 2020

Im waiting this aswell

@DerrickMartinez
Copy link

+1 for MariaDB

@congcongke
Copy link

After long long time... ...

@joey-yoonsung
Copy link

👍

@github-actions
Copy link

github-actions bot commented Jul 7, 2022

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

@github-actions github-actions bot added the Stale label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/database kind/requirement New feature or idea on top of harbor
Projects
None yet
Development

No branches or pull requests