Hi and welcome to Five’s Database Design series. This series of blog posts teaches you how to create a MySQL database from scratch in Five. From adding table fields to creating many-to-many relationships and importing data – we cover everything you need to know to build the perfect database.
Sometimes, instead of creating a new database from scratch, we would like to create a web interface for an existing database. Five lets us add an external database to the development environment by using a connection string. Five supports Microsoft SQL Server (MSSQL), MySQL, and SQLite.
This blog post explains how to add an external database to Five.
Five is a rapid application development environment for building database-driven web applications. Every application developed in Five has its own, fully customizable MySQL database.
In Five, you can create your database like in MySQL Workbench, with one important difference. You don’t need to write SQL commands to do so.
Five gives you the power of a database GUI in an easy-to-use and intuitive web application. You can create tables, assign data types, define table relationships, and import or query data.
Beyond its database features, Five lets you develop an entire web application on your database. Five makes it easy to build a modern web app with forms, charts, dashboards, and PDF reports that are all connected to your database.
Unlike traditional SQL tools, which only serve as a graphical user interface for a database (but are usually not very user-friendly), Five allows you to build and launch a web interface connected to a database. This makes Five ideal for rapidly creating internal databases to store data about products, inventory, business partners, to-do lists, members, suppliers, or other data.
To view Five’s web interface for databases, visit our customer database sample application here.
Five’s Databases feature lets us create a connection to an external, existing database, and then use Five to build a web interface on this database.
To add an external database, a connection string is required. The connection string represents a set of parameters in the form of key=value pairs separated by semicolons and must contain a Driver, URL, Username, Password, and Name.
Here is an example:
driver=MSSQL;url=serverdb.host.com:1433;username=user;password=password;name=exampleDB
Key | Value | Example |
---|---|---|
Driver | The database driver allows you to interact with your chosen DBMS through Five’s interface. | driver=MSSQL |
URL | A database connection URL provides a way of identifying a database so that the selected driver recognizes it and connects to it, this can be a host name or an IP address including the port number. | url=serverdb.host.com:1433 |
Username | Your username in your DBMS. | username=user |
Password | Your password in your DBMS. | password=password |
Name | The name of your database in your DBMS. | name=exampleDB |
Let’s learn how to use the add an external database.
To connect to an external database with Five, follow these steps:
Prerequisites:
Have at least one (empty) application ready in Five, as well as an external database compatible with Five.
1. In Five, select your application and click Manage.
2. Now go to Data > Databases.
3. Click the yellow Plus button.
4. Click the lookup icon in the Database Type field and select the type.
5. Type your connection string in the Connection String field following the above guidelines.
6. Last, click the Tick ✔️ Button to save.
Done! We have just connected Five to an external database.
Now that we have successfully established the connection to our external database, we must next import its schema to make it visible in Five. Once the schema is imported, you can, for example, view your external database’s tables inside Five and work with its data.
To do so, follow the steps shown in our documentation here.
In the last five articles, we have introduced core database design principles to you. We learned how to create tables and relationships, and how to import data into a database. Once our database is configured, the next step in our development process is creating forms. Our Advanced Forms series covers everything you need to know about building forms in Five.
Have more questions? Join our user community to connect with others and get answers.
Discover all articles of our Database Design series here.