Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions labs/mysql-auth-plugin/lab.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
id: "mysql-auth-plugin"
name: "MySQL Authentication Plugin Mismatch"
category: "database"
difficulty: "intermediate"
description:
summary: "An application is unable to authenticate with the MySQL database because the user account is configured with an incompatible authentication plugin."
id: mysql-auth-plugin
name: MySQL Authentication Plugin Mismatch
category: database
difficulty: intermediate
vm:
name: "mysql-auth-lab"
name: mysql-auth-lab
image: ubuntu-24.04-base.qcow2
memory: 2048
cpu: 2
disk: "20G"
cloud_init: "cloud-init.yaml"
verify_script: "verify.sh"
disk: 20G
cloud_init: cloud-init.yaml
verify_script: verify.sh

description:
summary: "An application is unable to authenticate with the MySQL database because the user account is configured with an incompatible authentication plugin."
story: "A legacy application is trying to connect to a new MySQL 8.0 instance. However, the connection fails with an authentication error. It appears the default authentication plugin used by MySQL 8.0 is not supported by the application's client library."
objectives:
- Identify the authentication plugin mismatch error
- Change the MySQL user's authentication plugin to 'mysql_native_password'
- Verify that the application can now successfully authenticate
tags:
- mysql
- database
- linux
- security
5 changes: 5 additions & 0 deletions labs/mysql-auth-plugin/solution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Change the authentication plugin for 'appuser' to 'mysql_native_password' (compatible with most clients)
mysql -e "ALTER USER 'appuser'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'apppassword';"
mysql -e "FLUSH PRIVILEGES;"
Loading