With RunCloud you can create and manage your databases using MariaDB, which is a popular and widely used database management system. You can create a separate database user for each database. These users are accounts that have permission to access and modify your database.
Creating A Database User
We need to create a database user before we create a database. To create a database user on RunCloud, follow these steps:
- On the RunCloud dashboard, select the server where you want to host your database.
- Click on Database in the left sidebar. This will show you all your existing databases.
- Click on Database Users in the sub-menu.
- Click on Add New Database User.
- Enter a username for your new database user. It is recommended to use a combination of letters, numbers, and symbols for the username.
- Click on Add Database User. This will create a new database user account on your server.
Creating A Database
After you have created a user, you can proceed to create a database.
- Click on Databases in the sub-menu.
- Click on Add New Database.
- Enter a name for your new database. It must be at least 5 characters long.
- Optionally, choose a collation for your new database. A collation is a set of rules that determines how data is sorted and compared in your database. You can leave this field blank to use the default collation. Refer to our post on database collations to understand how to use this setting.
- Assign a database user to your new database. You can choose the database user you just created, or any other existing database user on your server. The assigned database user will have full permissions to access and modify your database.
- Click on Save Database.
Your new database will be created and added to your server. You can see the details of your database on the Databases page. You can also manage your database users and databases by clicking on the ellipsis (three dots) icon next to them, and choosing from the available options, such as:
- Delete: Remove a database user or a database from your server.
- Assign & Revoke User: Grant access to a database user or remove a database user from a database and revoke their permissions.
After creating the required database and user accounts, you can link this database to your web application. This would allow you to perform automatic backups of your database along with your web application.
To link the database, go to the web application dashboard and click on the “Settings” button on the left. On the settings page, scroll down to the “Linked Databases” section and select your database from the drop-down menu.
After selecting the database, click on the “Update Linked Database” to save the changes.
Note: You can use your new database for any web application you deploy on your server. To do so, you will need to enter the database name, username, password, and host (localhost) when you configure your web application settings.