Connecting to a database¶
Baclan can keep plates, classes and models on a MySQL or MariaDB server, in place of files. A database holds images as well as tables, so a server can be the one place where a laboratory's plates live, and several people can work from it at once.
The switch and the name¶
Two things on the top toolbar decide this:
| Control | Does |
|---|---|
| The switch | Pressed, with its red no-entry sign showing, Baclan works with files. Released, the Add Plate, Add Class, Save Model and Load Model buttons work with the database |
| The yellow label | The database in use. Click it to choose another |
Choosing a database¶
Click the yellow label. The Database Connection window lists servers, the users on each, and the databases each user can see.
| Button | Does |
|---|---|
| Add/Change | Opens the Connection Editor for a new server, or for the one selected |
| Create New Database | Makes a database with the name in the box beside it, on the selected server and user, with Baclan's tables |
| Remove | Forgets the selected server or user, after saying what it will forget. The databases stay on the server |
| Refresh | Asks the servers again which databases each user can see. A list it cannot read completely is kept as it was |
| Ok | Uses the selected database. A double-click on a database does the same; on a server or a user it opens or closes it |
| Close | Leaves things as they were |
The Connection Editor¶
| Field | Meaning |
|---|---|
| Host Short Name (Optional) | A short name to show in place of the server's address |
| Host | The server's name or address |
| Port | The port, usually 3306 |
| User, Password | The login. Show Password shows what you type |
Test tries the connection. Ok adds it to the list.
Passwords are stored
The connections, with their passwords, are kept in %APPDATA%\Baclan\Servers.dat, so that Baclan
can reconnect by itself. Treat that file as you would the passwords, and use accounts with no more
rights than they need. The Manager makes read-only accounts.
What goes in the database¶
| Saved with | What |
|---|---|
| Save Plate, Save To Database | A plate with its images and details |
| Save Class | A class: a name and a list of plates |
| Save Model | A model, with its classes, its SVM and its settings |
| Save the report | The class given to each colony by a model |
BacBuster saves its plates in the same kind of database.
Look through a database with the Database Control Panel. Without a connection to the named database, the database buttons say Not connected to ....