Browse Source

mariadb meltdown

windhamdavid 5 months ago
parent
commit
b67a4d3e41
2 changed files with 35 additions and 5 deletions
  1. 10 2
      docs/computers/ovid.md
  2. 25 3
      posts/2024-07-10-posts.md

+ 10 - 2
docs/computers/ovid.md

@@ -8,7 +8,7 @@
 
 ### Log
 
-**24.07.10** - Had a MariaDB meltdown and wrote up a quick summary @ [/posts/mariadb-meltdown](/posts/mariadb-meltdown) as a reference.
+**24.07.10** - Had a MariaDB meltdown and wrote up a quick summary @ [/posts/mariadb-meltdown](/posts/mariadb-meltdown) as a reference. Switched back to MySQL 8.3
 
 **23.11.26** - Vecel bumped their [default Ruby runtime](https://vercel.com/changelog/upgrading-ruby-v2-7-to-v3-2) to v3.2 so I decided to switch out the global on this machine. Had a build error and had to install libyaml manually.
 
@@ -470,7 +470,7 @@ david@ovid:~ » psql
 psql (14.1)
 ```
 
-~~MySQL~~ MariaDB ( switched from MySQL will migrate next server )
+MySQL ~~MariaDB~~ ( switched from MySQL and then switched back - see [#log](#log))
 
 ```bash
 david@ovid:~ » sqlite3
@@ -482,6 +482,14 @@ david@ovid:~ » sudo /opt/homebrew/bin/mysql_secure_installation
 david@ovid:~ » sudo $(brew --prefix mariadb)/bin/mysqladmin -u root password PASSWORD  
 ```
 
+```bash
+brew remove mariadb
+brew install mysql
+brew services start mysql
+david@ovid🏛 :~/sites/daw_til(main⚡) » mysql --version
+mysql  Ver 8.3.0 for macos14.2 on arm64 (Homebrew)
+```
+
 MongoDB ( Community ) - moved from an open source license so it was dropped by homebrew.
 
 ```bash

+ 25 - 3
posts/2024-07-10-posts.md

@@ -7,7 +7,7 @@ description: Today I learned how to fix some seriously corrupted database tables
     title: Something Else
     url: https://davidawindham.com
     image_url: https://davidawindham.com/wp-content/themes/daw/img/opengraph_image.jpg -->
-tags: [database, mysql, ovid]
+tags: [database, mysql, mariadb, ovid]
 image: https://davidawindham.com/wp-content/themes/daw/img/opengraph_image.jpg
 hide_table_of_contents: true
 ---
@@ -95,7 +95,7 @@ ALTER TABLE mysql.column_stats MODIFY histogram longblob;
 ALTER TABLE mysql.column_stats MODIFY hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB');
 ```
 
-At this point I kinda knew the best option would be the ole' restart or reinstall. I decided to wipe it clean and reinstall the databases. Luckily I was able to knock it out within a couple hours 🙌🏼 and it's back up and running. 
+At this point I kinda knew the best option would be the ole' restart or reinstall. I decided to wipe it clean and reinstall MariaDB.
 
 ```sh
 240710 11:14:32 mysqld_safe Starting mariadbd daemon with databases from /opt/homebrew/var/mysql
@@ -122,7 +122,29 @@ At this point I kinda knew the best option would be the ole' restart or reinstal
 2024-07-10 11:14:32 0 [Note] /opt/homebrew/opt/mariadb/bin/mariadbd: ready for connections.
 Version: '11.4.2-MariaDB'  socket: '/tmp/mysql.sock'  port: 3306  Homebrew
 ```
---- 
+
+Once it was back up running, I checked all of the database tables for corruption but could find `NONE`. Perplexed, I restarted MariaDB a couple of times successfully and then I rebooted my computer and 💣 it blew out again with the same errors. I went on a deeper dive and found a similar error from another user which had a response from a MariaDB developer. I listened to a presentation by this person and then made the switch back over to MySQL 8.3. As much as I bemoan the Oracle acquisition of MySQL, it matches up with most remote servers and it certainly saved me some time migrating the database servers. 
+
+```sh
+brew remove mariadb
+brew install mysql
+brew services start mysql
+sudo /opt/homebrew/bin/mysql_secure_installation
+mysql -u root -p < /Users/david/Downloads/24.7_localhost.sql
+
+//opt/homebrew/etc/my.cnf
+[mysqld]
+collation_server = utf8mb4_unicode_520_ci
+character_set_server = utf8mb4
+
+utf8mb4_general_ci ( fastest )
+utf8mb4_unicode_520_ci ( most accurate for multi language )
+utf8mb4_0900_ai_ci ( specific to MySQL 8x)
+```
+
+Rebooted [Ovid 💻](/docs/computers/ovid) and all is well. 
+
+---
 
 🔥 NOTE: I should remember to do a little housecleaning more often though because I found some other loose ends in my homebrew packages. And this reminded me about every previous time I've had to debug an error with MySQL and about my favorite video on the topic 👇🏼