Installing MySQL
During MySQL installation, you will need to enter a password. Enter password: ihmysql
Installing by the apt-get command
In the terminal, run the commands:
sudo apt-get update
sudo apt-get install mysql-server
Installing from a deb package
Download deb package here
Then run the following commands:
sudo dpkg -i mysql-apt-config_*_all.deb
sudo apt-get update
sudo apt-get install mysql-server
Installing MariaDB
In Debian Stretch, the MySQL database (which was in Jessie) was replaced with MariaDB
The image of the intraHouse system for Raspberry Pi Mini-PC is prepared on the basis of the Raspbian Stretch Lite operating system. Therefore, when installing the database, MariaDB is installed by default.
The procedure for installing the database:
1. Install the database:
sudo apt-get update
sudo apt-get install mysql-server
When installing MariaDB, the password is not requested.
2. Run the command:
sudo mysql_secure_installation
enter the password for root: ihmysql
answer all other questions yes
3. Login to the database:
sudo mysql -u root -p
enter the password for root: ihmysql
4. Run the following commands (at the end of the command semicolon is necessary):
use mysql;
update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';
flush privileges;
5. Exit the database:
exit
6. Restart the database:
sudo service mysql restart
7. Reboot the intraHouse system
Deleting the database
Attention! When you delete all the information stored in the database will be deleted without the possibility of recovery. After reboot the intraHouse system will continue its work without the possibility of accumulating information.
1. Stop the service:
sudo service mysql stop
2. Run the following commands:
sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get autoremove