So, this is a relatively new website which means I am regularly trying out new themes until I feel like one fits me. I’m a minimalist person so I typed in simple and had a bit of a scroll, came across one called SimpleNotes. Thumbnail looked good, clicked preview and came up with an error.
In my ignorant thinking, oh the preview must be broken, I’ll just apply it anyway. Entire website becomes inaccessible, great! Throw into google “Fix please”, comes out with, oh just login to phpMyAdmin and locate the table change the theme setting to something else and you’re done. Sounds simple enough, apart from the fact I don’t have phpMyAdmin installed! Oh I know, I’ll login to MariaDB through command line, try that, MariaDB isn’t installed….what?
Right, the entire webserver is served through a docker container, how the fuck do I connect to MariaDB through docker. Bit of googling come across the docker exec command:
docker exec -it mdb mariadb --user root -pPassword123!
Whilst the command did not work out of the box, with a little bit of tinkering I got in, whilst I did Advanced Databases as one of my modules at university, in this particular instance my mind went blank. Throwing out some commands, it just wasn’t doing anything. Quickly remembered I need to put a semi colon at the end of the statements. Rookie mistake!
Slap in SHOW TABLES; wp_options is the one I need then: SELECT * FROM wp_options; ah yes, about a billion rows appear; I’m not reading that. I didn’t actually know what I was looking for, so went back to google to find another way.
If I really thought about it, the solution was pretty obvious. Navigate to the theme folder, rename to the current theme to something else, rename another theme to “current theme”. I could now access this site again, hurray. Little bit of clean up and I was back to where I started about an hour earlier. Obviously continued to look at themes but not before enabling a snapshot backup which would have fixed this whole thing a lot sooner!