Admin panel

Databases

What this does: these tools look after the database servers on this machine. A database is where a website keeps its content in an organised way: a WordPress site, for example, keeps its posts, pages and users in one. Customers make their own databases in their own panel; here you see all of them, tune the database servers, and fix problems.

When you need it: when sites are slow because the database server is short of memory or connections, when a customer needs to reach their database from their own computer, or when you want to upgrade the database server.

Words used on this page:

Database servers

What this does: shows each database server this machine runs, whether it is running, how long it has run, how many connections are open, and how much data it holds. You can also see the open connections and end one that is stuck.

When you need it: when sites that use databases are slow or show "error establishing a database connection".

Where: Databases > Database servers

To check a database server

  1. Open Databases > Database servers. Each server has a card, for example MariaDB, with its state, such as Running.
  2. Read Connections, for example "7 open of 151". If the first number is close to the second, the server is nearly full. Data and indexes is how much disk the databases take (GiB is about a gigabyte). Recorded by the panel counts the accounts and databases the panel knows about.

A card marked runs elsewhere (such as "Reporting replica" in the picture) is a database server on another machine that you defined yourself; see below.

  1. Click Show connections to list them. The table shows each connection's User, Database, State and how many Seconds it has run, longest first.
  2. To end a stuck connection, click End in its row, then confirm. You see The connection was ended.
The Database servers page with the MariaDB and PostgreSQL cards showing their version, uptime, connections, size and the databases the panel has recorded

To define a database server that runs elsewhere

You can record a database server on another machine and test that it answers. Nothing is placed on it yet; a later freePanel release can use it.

  1. Scroll to the card Define a server that runs elsewhere.
  2. Fill in Name, Kind of server (MariaDB or PostgreSQL), Host (a name or address, without a port), Port (empty means the usual one), Administrator login and Password.
  3. In Connection, choose Encrypted, certificate checked if you can: the connection is scrambled, and the panel checks the other server's certificate (its proof of identity) so no one can pretend to be it.
  4. Click Define server. You see "Defined (name). Test it to see that it answers."
  5. On the new card, click Test. You see "Tested (when): it answered, version (version), in (ms) ms."

If something goes wrong

Database server settings

What this does: changes the few settings of MariaDB and PostgreSQL that matter most for speed: how many connections they accept and how much memory they use.

When you need it: only when the database server is short of something, such as connections or memory. A box left empty lets the server decide.

Where: Databases > Database server settings

To change a database setting

  1. Open Databases > Database server settings. Each server has its own card. The card says how much memory this machine has, for example "This machine has 8 GB of memory."
  2. Find the setting. Each one shows its plain name, its technical name in brackets, what it does, its range, and Running now: with the value in use.
  3. The boxes start empty: empty means the server decides for itself, and Running now: shows what it uses. To change a setting, type the new number in its box. To go back to the server's own value later, empty the box again.
  4. Click Save changes. You see "Saved. One setting changed." (or how many changed).
  5. Some settings say Needs a restart. The page then lists them as waiting. Restart the database server when it suits you: click Open Services and restart it there.
The Database server settings page for MariaDB, with Most connections at once, Table cache in memory and the other settings with their current values

Words you will meet on this page: InnoDB and MyISAM are two ways MariaDB stores tables (almost every site today uses InnoDB); a temporary table is scratch space MariaDB makes while it answers a big question; "packet too large" is the error a big import gives when Largest query or row is too small.

The two settings most hosts change are Most connections at once (when sites get "too many connections") and Table cache in memory (the memory MariaDB uses to keep data close; the bigger, the faster, as long as the machine has the memory).

If something goes wrong

All databases

What this does: lists every database the panel knows about, on both database servers, with the account it belongs to and its size.

When you need it: to find which account owns a database, or which databases are the biggest.

Where: Databases > All databases

To find a database

  1. Open Databases > All databases.
  2. In Name contains, type part of the database's name. In Account, type an account's exact name. In Server, choose Both, MariaDB or PostgreSQL.
  3. Click Search. The table Databases lists each Database, its Account, its Server and its Size.
  4. Use Previous and Next to move through long lists.
The All databases page with the Find databases form and the table of databases with their account, server and size

If something goes wrong

Database admin password

What this does: gives the database server's own administrator login (root for MariaDB, postgres for PostgreSQL) a password, for your own use at the server's command line (the text window you reach over SSH). With it you can, for example, run mysql -u root -p on the server and type the password.

When you need it: only if you want to work with the databases yourself at the command line with a password. The panel does not need it: it signs in without this password and keeps doing so.

Where: Databases > Database admin password

To set the database admin password

  1. Open Databases > Database admin password. Read the warning: this password opens every customer's database.
  2. In the card of the server, for example MariaDB, type a password in New password. It needs at least 16 characters, with at least 8 different ones. Or click Make one for me, and copy the password it shows.
  3. Type it again in The password again.
  4. Click Set the password of root (or of postgres).
  5. You see "The password is set for (login). It is not shown again." Keep it somewhere safe.
The Database admin password page with a card for MariaDB and one for PostgreSQL, each with the New password boxes

If something goes wrong

Upgrade MariaDB

What this does: moves MariaDB to a newer version from this server's own package source (the place the operating system gets its software from; the page names it, for example dnf module). Before it changes anything, it saves a full copy (a dump) of every database and checks it, and copies MariaDB's data folder (where it keeps the databases on disk). If any step fails, it puts the old version and data back.

When you need it: when a customer's software needs a newer MariaDB, or when your version is old.

Where: Databases > Upgrade MariaDB

To upgrade MariaDB

  1. Open Databases > Upgrade MariaDB. The card What runs now shows the current Version.
  2. The card Upgrade lists the steps it takes. In Upgrade to, choose the newer version, for example MariaDB 11.4.
  3. Tick I understand MariaDB stops while it upgrades.
  4. Click Upgrade MariaDB.
  5. The card Latest upgrade shows "running" and checks again every few seconds. You can watch the Upgrade log.
  6. When it ends, you see the upgrade's name followed by "finished.", for example "MariaDB 11.4: finished."
The Upgrade MariaDB page showing the running version, the steps of the upgrade, MariaDB 11.4 chosen in Upgrade to, the box ticked and the Upgrade MariaDB button

If something goes wrong

Remote database access

What this does: lets customers connect to their MariaDB (MySQL) databases from other computers, for example from a program on their own office machine. Each customer lists the addresses allowed to connect.

When you need it: when a customer asks to reach their database from outside this server. It is off by default, which is the safest choice.

Where: Databases > Remote database access

To turn on remote database access

  1. Open Databases > Remote database access. The card MySQL and MariaDB shows whether Remote access is On or Off, what MariaDB listens on, the Port (normally 3306) and the Firewall.
  2. Read the two paragraphs: MariaDB does not lock out wrong passwords, and the traffic is not encrypted.
  3. Click Turn on remote access.
  4. A question explains what happens: MariaDB restarts, the port is opened in the firewall, and customers can list hosts. Confirm with Turn on remote access.
  5. You see Remote access is on.
The Remote database access page with remote access Off, MariaDB listening on this machine only, and the Turn on remote access button

Customers then add the addresses they connect from in their own panel. To turn it off, click Turn off remote access and confirm. Customers keep their lists, but nobody can connect from outside.

If something goes wrong

Database map

What this does: compares the panel's record of an account's databases and users with what the database server really has, and repairs the record when they differ.

When you need it: when someone deleted a database or a user directly at the database server's command line, and the customer's panel still lists it, or shows errors.

Where: Databases > Database map

To check and repair an account

  1. Open Databases > Database map.
  2. In Database server, choose MariaDB or PostgreSQL.
  3. In Account name, type the account's login name, for example site1.
  4. Click Check.
  5. If all is well, you see "The record of (account) and the database server agree. There is nothing to repair."
  6. If not, you see "The record of (account) and the database server do not agree." with a list of what is wrong. Click Repair and confirm.
  7. You see "Repaired." with how many databases and users left the record.
The Database map page with MariaDB chosen, site1 typed in the Account name box and the Check button

The repair never makes or deletes a database or a user. It only fixes the record and takes away rights that should not be there.

If something goes wrong

MongoDB

What this does: installs MongoDB on this server, or removes it. MongoDB is a different kind of database: it keeps each record as a document (much like a small file of named values) instead of rows in a table. Some apps, mostly ones written in Node.js, need it. Once it is installed, customers make their own MongoDB databases and users in their panel, under Databases > MongoDB databases.

When you need it: when a customer's app asks for MongoDB. If nobody needs it, leave it off: it uses memory even when idle.

Where: Databases > MongoDB

MongoDB comes from MongoDB's own download site, so the Version list always shows the versions MongoDB offers for your server's system today. You choose the version once; updates within it come with the server's normal updates.

What it needs:

If the server doesn't meet these, the page says "MongoDB cannot be installed on this server." with the reason.

To install MongoDB

  1. Open Databases > MongoDB. You see "MongoDB is not installed."
  2. Click Install MongoDB.
  3. In Version, leave the newest version chosen unless an app needs an older one.
  4. In Your password, type the password you sign in to this panel with.
  5. Click Install MongoDB. Keep the page open: Progress shows each step, and it takes a few minutes.
  6. When you see "Done." and "MongoDB (version) is running.", customers can make MongoDB databases.
The MongoDB page with MongoDB not installed, the Version list showing 9.0 (newest), the Your password box and the Install MongoDB button

MongoDB listens on this server only (127.0.0.1) and every connection needs a password. No firewall port is opened for it, so apps on other computers can't reach it. Each customer's users can only open that customer's own databases.

To remove MongoDB

  1. First, the customers must remove their MongoDB databases and users. The page shows how many accounts still have some in Accounts with MongoDB databases or users.
  2. Open Databases > MongoDB and click Remove MongoDB.
  3. Type your password and click Remove MongoDB again.

MongoDB is stopped and its packages removed. Its data folder and settings are kept on the server under a dated name, so nothing is lost by mistake.

If something goes wrong