In Windows, install Apache and MariaDB as services and always use the Services App to start/stop MariaDB because the XAMPP Control Panel can wreck your database when you start and stop it there.
While you are at it, you might as well use the Services App to start and stop Apache too.
If you wreck your database, you may need to restore from your “/mysql/backup/” directory to fix it. Here you will copy everything except “ibdata1” and “my.ini” to your /mysql/data/ data directory. Backup your “/mysql/data/” directory before doing this. You will have to create users, grant premissions and set passwords again if you do this.