So, If i create the folder php inside run, php runs but if i reboot the folder disappears and it stops working again.
As for mariadb here are the results:
systemctl restart mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
journalctl -u mariadb
-- Logs begin at Thu 2019-02-14 10:11:59 GMT, end at Thu 2020-10-22 13:17:50 BST. --
Oct 22 11:47:56 DietPi systemd[1]: Starting MariaDB 10.3.25 database server...
Oct 22 11:47:57 DietPi mysqld[460]: 2020-10-22 11:47:57 0 [Note] /usr/sbin/mysqld (mysqld 10.3.25-MariaDB-0+deb10u1) starting as process 460 ...
Oct 22 11:48:01 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 11:48:02 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Oct 22 11:48:02 DietPi systemd[1]: Failed to start MariaDB 10.3.25 database server.
Oct 22 11:48:13 DietPi systemd[1]: Starting MariaDB 10.3.25 database server...
Oct 22 11:48:13 DietPi mysqld[655]: 2020-10-22 11:48:13 0 [Note] /usr/sbin/mysqld (mysqld 10.3.25-MariaDB-0+deb10u1) starting as process 655 ...
Oct 22 11:48:16 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 11:48:16 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Oct 22 11:48:16 DietPi systemd[1]: Failed to start MariaDB 10.3.25 database server.
Oct 22 13:14:42 DietPi systemd[1]: Starting MariaDB 10.3.25 database server...
Oct 22 13:14:42 DietPi mysqld[1263]: 2020-10-22 13:14:42 0 [Note] /usr/sbin/mysqld (mysqld 10.3.25-MariaDB-0+deb10u1) starting as process 1263 ...
Oct 22 13:14:45 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 13:14:45 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Oct 22 13:14:45 DietPi systemd[1]: Failed to start MariaDB 10.3.25 database server.
Oct 22 13:17:22 DietPi systemd[1]: Starting MariaDB 10.3.25 database server...
Oct 22 13:17:22 DietPi mysqld[1395]: 2020-10-22 13:17:22 0 [Note] /usr/sbin/mysqld (mysqld 10.3.25-MariaDB-0+deb10u1) starting as process 1395 ...
Oct 22 13:17:25 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 13:17:25 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Oct 22 13:17:25 DietPi systemd[1]: Failed to start MariaDB 10.3.25 database server.
Oct 22 13:17:46 DietPi systemd[1]: Starting MariaDB 10.3.25 database server...
Oct 22 13:17:47 DietPi mysqld[1486]: 2020-10-22 13:17:47 0 [Note] /usr/sbin/mysqld (mysqld 10.3.25-MariaDB-0+deb10u1) starting as process 1486 ...
Oct 22 13:17:50 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 13:17:50 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Oct 22 13:17:50 DietPi systemd[1]: Failed to start MariaDB 10.3.25 database server.
cat /var/log/mysql/error.log
2020-10-22 13:17:22 0 [Note] InnoDB: Using Linux native AIO
2020-10-22 13:17:22 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-10-22 13:17:22 0 [Note] InnoDB: Uses event mutexes
2020-10-22 13:17:22 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-10-22 13:17:22 0 [Note] InnoDB: Number of pools: 1
2020-10-22 13:17:22 0 [Note] InnoDB: Using generic crc32 instructions
2020-10-22 13:17:22 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-10-22 13:17:22 0 [Note] InnoDB: Completed initialization of buffer pool
2020-10-22 13:17:22 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/gtid_slave_pos.ibd' OS error: 81
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`gtid_slave_pos``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:22 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`gtid_slave_pos` because it could not be opened.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_index_stats.ibd' OS error: 81
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_index_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:22 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`innodb_index_stats` because it could not be opened.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_table_stats.ibd' OS error: 81
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_table_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:22 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`innodb_table_stats` because it could not be opened.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/transaction_registry.ibd' OS error: 81
2020-10-22 13:17:22 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`transaction_registry``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:22 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`transaction_registry` because it could not be opened.
2020-10-22 13:17:22 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-10-22 13:17:22 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-10-22 13:17:22 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-10-22 13:17:22 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-10-22 13:17:22 0 [Note] InnoDB: Waiting for purge to start
2020-10-22 13:17:22 3 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`innodb_index_stats` in the cache. Attempting to load the tablespace with space id 2
2020-10-22 13:17:22 3 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 3 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 3 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_index_stats.ibd' OS error: 81
2020-10-22 13:17:22 3 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 3 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 3 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_index_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:22 4 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`innodb_table_stats` in the cache. Attempting to load the tablespace with space id 1
2020-10-22 13:17:22 4 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 4 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 4 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_table_stats.ibd' OS error: 81
2020-10-22 13:17:22 4 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:22 4 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:22 4 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_table_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:22 0 [Note] InnoDB: 10.3.25 started; log sequence number 288349105; transaction id 1003249
2020-10-22 13:17:22 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/ebd99df1-1979-4f52-a467-6885fa2107d5/dietpi_userdata/mysql/ib_buffer_pool
2020-10-22 13:17:22 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-10-22 13:17:22 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2020-10-22 13:17:22 0 [Note] Recovering after a crash using tc.log
2020-10-22 13:17:22 0 [ERROR] Bad magic header in tc log
2020-10-22 13:17:22 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2020-10-22 13:17:22 0 [ERROR] Can't init tc log
2020-10-22 13:17:22 0 [ERROR] Aborting
2020-10-22 13:17:47 0 [Note] InnoDB: Using Linux native AIO
2020-10-22 13:17:47 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-10-22 13:17:47 0 [Note] InnoDB: Uses event mutexes
2020-10-22 13:17:47 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-10-22 13:17:47 0 [Note] InnoDB: Number of pools: 1
2020-10-22 13:17:47 0 [Note] InnoDB: Using generic crc32 instructions
2020-10-22 13:17:47 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-10-22 13:17:47 0 [Note] InnoDB: Completed initialization of buffer pool
2020-10-22 13:17:47 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/gtid_slave_pos.ibd' OS error: 81
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`gtid_slave_pos``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:47 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`gtid_slave_pos` because it could not be opened.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_index_stats.ibd' OS error: 81
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_index_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:47 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`innodb_index_stats` because it could not be opened.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_table_stats.ibd' OS error: 81
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_table_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:47 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`innodb_table_stats` because it could not be opened.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/transaction_registry.ibd' OS error: 81
2020-10-22 13:17:47 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`transaction_registry``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:47 0 [Warning] InnoDB: Ignoring tablespace for `mysql`.`transaction_registry` because it could not be opened.
2020-10-22 13:17:47 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-10-22 13:17:47 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-10-22 13:17:47 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-10-22 13:17:47 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-10-22 13:17:47 0 [Note] InnoDB: 10.3.25 started; log sequence number 288349114; transaction id 1003249
2020-10-22 13:17:47 1 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`innodb_index_stats` in the cache. Attempting to load the tablespace with space id 2
2020-10-22 13:17:47 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/ebd99df1-1979-4f52-a467-6885fa2107d5/dietpi_userdata/mysql/ib_buffer_pool
2020-10-22 13:17:47 1 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 1 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 1 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_index_stats.ibd' OS error: 81
2020-10-22 13:17:47 1 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 1 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 1 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_index_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-10-22 13:17:47 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-10-22 13:17:47 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2020-10-22 13:17:47 0 [Note] Recovering after a crash using tc.log
2020-10-22 13:17:47 0 [ERROR] Bad magic header in tc log
2020-10-22 13:17:47 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2020-10-22 13:17:47 0 [ERROR] Can't init tc log
2020-10-22 13:17:47 0 [ERROR] Aborting
2020-10-22 13:17:47 2 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`innodb_table_stats` in the cache. Attempting to load the tablespace with space id 1
2020-10-22 13:17:47 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 2 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_table_stats.ibd' OS error: 81
2020-10-22 13:17:47 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-10-22 13:17:47 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-10-22 13:17:47 2 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_table_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
readlink -f /var/lib/mysql
/mnt/ebd99df1-1979-4f52-a467-6885fa2107d5/dietpi_userdata/mysql