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:
db_host = 192.168.222.79
db_password = mypassword
db_port = 3306
db_user = root
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
Harbor only supports PostgreSQL currently due to the limitation of the upstream repository.
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?
The change is introduced in version 1.6.0, and the DATABASE_TYPE is for extensibility, but it only supports PostgreSQL currently.
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.
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.
Other DBs to consider:
I am blocked because of this issue. Could you provide more details regarding the roadmap? Thanks
I think mysql or mariadb is preferred, different thinking with @WSLUser.
Whether the support of MySQL database has been considered? This ability is urgently needed.
Also very much looking forward to supporting mysql or mariadb.
Im waiting this aswell
Most helpful comment
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.