I have spent the entire day trying to get my sql running but I just don't know what I am doing wrong. I have went through most of stackoverflow answers but have not found a thing that works to get my sql running. I ran mysqld and got the following information (which I don't really know how to interpret):
2020-12-18T03:59:57.157351Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2020-12-18T03:59:57.263898Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22-0ubuntu0.20.04.3) starting as process 210589
2020-12-18T03:59:57.364391Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2020-12-18T03:59:57.366492Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2020-12-18T03:59:57.404650Z 0 [Warning] [MY-010122] [Server] One can only use the --user switch if running as root
2020-12-18T03:59:57.406047Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/var/lib/mysql/' (OS errno: 13 - Permission denied)
2020-12-18T03:59:57.407722Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-12-18T03:59:57.442036Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22-0ubuntu0.20.04.3) (Ubuntu).
I am hosting the application on Digitalocean and it is in production but broken as it cannot see the db. I ran apache2 restart which went fine. I then ran mysql stop, start, restart commands which all gave me the following:
Job for mysql.service failed because a fatal signal was delivered to the control process.
See "systemctl status mysql.service" and "journalctl -xe" for details.
Frustrated and stumped, any help appreciated. Thank you in advance. If I missed anything, I will be happy to edit my question, just let me know. Thanks.
Edit: Restarted server within DigitalOcean and now the application works and I can access mysql.