- Setting Up a Dedicated Database Server on Raspberry Pi
- Setup a Raspberry Pi MYSQL Database
- How To Allow Remote Access to MySQL
Brug LibreOffice 7.6.4 eller nyere
- Raspberry Pi: 836,00 Kr.
- Harddisk 1TB: 795,00 Kr.
- To install fan control, use this script:
curl https://download.argon40.com/argon1.sh | bash
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
- Select Raspberry Pi OS (other)
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]
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]
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
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]
- 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]
- Connect to an existing database