Skip to content

Latest commit

 

History

History
194 lines (143 loc) · 4.07 KB

File metadata and controls

194 lines (143 loc) · 4.07 KB

LibreOffice-Base & Raspberry pi 4 med MariaDB SQL-server

Kilder

LibreOffice-Base

Brug LibreOffice 7.6.4 eller nyere

Hardware

Argon One M.2 SSD

  • To install fan control, use this script:
curl https://download.argon40.com/argon1.sh | bash

Raspberry pi OS

Brug Raspberry Pi OS Lite (64bit) eller Raspberry Pi OS Full (64bit),

  • Install med Raspberry Pi Imager
    • Select Raspberry Pi OS (other)
      • Raspberry Pi OS Lite (64bit) eller Raspberry Pi OS Full (64bit)
    • Select Storage Device
    • Select Image customization options
      • set hostname: mysqlpc
      • Enable SSH
        • Use password authentication
      • Set Username and password
      • Configure wireless LAN
    • Save
    • WRITE

Setup a Raspberry Pi Mariadb Database

SSH to Database server

ssh omjk@omjksql.local
sudo apt update && sudo apt upgrade -y
sudo apt install mariadb-server -y
sudo mysql_secure_installation
sudo mysql -u root -p

To exit MySQL type " quit;" or Press [CTRL] + [D]

Creating a MySQL Database and Local User

sudo mysql -u root -p
CREATE DATABASE exampledb;
CREATE USER 'localuser'@'localhost' IDENTIFIED BY 'pimylifeup';
GRANT ALL PRIVILEGES ON exampledb.* TO 'localuser'@'localhost';
FLUSH PRIVILEGES;
quit;

To exit MySQL type " quit;" or Press [CTRL] + [D]

Create Remote User

sudo mysql -u root -p
CREATE USER 'remoteuser'@'%' IDENTIFIED BY 'pimylifeup';
GRANT ALL PRIVILEGES ON exampledb.* TO 'remoteuser'@'%';
FLUSH PRIVILEGES;

To exit MySQL type " quit;" or Press [CTRL] + [D]

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
bind-address=0.0.0.0

[CTRL]+[o], [ENTER] [CTRL]+[x]

service mysql restart

Test Remote User

Open terminal på Remote PC

Install Mariadb client:

  sudo apt install mariadb-client-core-10.6 

Test conection:

mysql -u remoteuser -p -h 192.168.0.8 -P 3306
SHOW DATABASES;

Svar se ud som dette:

MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| exampledb          |
| information_schema |
+--------------------+
2 rows in set (0,002 sec)

To exit MySQL type " quit;" or Press [CTRL] + [D]

LibreOffice-Base connection

  • Select database
    • Connect to an existing database
      • MySQL/MariaDB
    • [Next]
      • Connect directly (using MariaDB C connector)
    • [Next]
      • Database name: exampledb
      • Server: omjksql.local
      • Port: 3306
    • [Next]
      • User name: remoteuser
      • Password required
      • [Test Connection]
        • Password: pimylifeup
        • [OK]
        • If OK then [Next]
    • Save and proceed
      • Yes, register the database in LibreOffice
      • Open the database for editing
    • [Finish]