...
For quickly spinning up Fedora in a testing / experimental context, a default H2 database is available by default.
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
|
However, for production installations, it is recommended to use a MariaDB, MySQL or PostgreSQL database.
Note |
---|
Fedora currently supports the following versions:
|
Below are the steps to use MySQL, MariaDB or PostgreSQL, as well as Docker instructions if you choose to run your database in a Docker container.
Info |
---|
For the full list of database properties, please refer to the Database section of the Properties documentation. You can find additional information on this wiki about how Fedora rebuilds these caches and the structure of the tables in the database. |
Table of Contents |
---|
Native Database Setup
...
Code Block |
---|
$ mysql -u root -p > createCREATE databaseDATABASE fcrepo CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; > createCREATE userUSER 'user1'@'localhost' IDENTIFIED BY 'xyz'; > GRANT ALL PRIVILEGES ON fcrepo.* to 'user1'@'localhost'; > \q |
Note |
---|
MySQL and MariaDB use case insensitive collations by default, but resources in Fedora are case sensitive. If you decide to create your database using a case insensitive collation, then Fedora will not be able to handle case appropriately, leading to undefined behavior. |
PostgreSQL
To create a new database and user in PostgreSQL, assuming a username of user1
and a password of xyz
:
Code Block |
---|
$ sudo -u postgres psql > createCREATE databaseDATABASE fcrepo; > createCREATE userUSER user1; > alterALTER userUSER user1 passwordPASSWORD 'xyz'; > grantGRANT allALL privilegesPRIVILEGES onON databaseDATABASE fcrepo toTO user1; > \q |
Docker-based Database Setup
...
No Format |
---|
docker run --name f6-mariadb -e MYSQL_ROOT_PASSWORD=root-pw -e MYSQL_DATABASE=fcrepo -e MYSQL_USER=fcrepo-user -e MYSQL_PASSWORD=fcrepo-pw -p 3306:3306 -d mariadb:10.5.3 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
..when done with the database:
docker stop f6-mariadb
docker rm f6-mariadb |
...
No Format |
---|
docker run --name f6-mysql -e MYSQL_ROOT_PASSWORD=root-pw -e MYSQL_DATABASE=fcrepo -e MYSQL_USER=fcrepo-user -e MYSQL_PASSWORD=fcrepo-pw -p 3306:3306 -d mysql:8.0 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
..when done with the database:
docker stop f6-mysql
docker rm f6-mysql |
...