diff --git a/.github/workflows/pr-wordpress-tests.yml b/.github/workflows/pr-wordpress-tests.yml index 9f2aa3e..94b7668 100644 --- a/.github/workflows/pr-wordpress-tests.yml +++ b/.github/workflows/pr-wordpress-tests.yml @@ -22,6 +22,7 @@ jobs: - examples/wordpress-mariadb - examples/wordpress-mariadb-mysql - examples/wordpress-mysql8 + - examples/wordpress-mysql84 - examples/wordpress-nginx - examples/wordpress-recommended lando-version: @@ -64,3 +65,4 @@ jobs: cleanup-header: "Destroy tests" shell: bash stdin: true + version: 1.0.0-beta.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 92ce77b..cf6774d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Fixed MySQL 8.2+ startup failure by replacing removed `expire_logs_days` with `binlog_expire_logs_seconds` [#107](https://github.com/lando/wordpress/issues/107) +* Fixed `mysql:8` startup failure by using the MySQL 8 config instead of the 5.7 config + ## v1.11.0 - [March 11, 2026](https://github.com/lando/wordpress/releases/tag/v1.11.0) * Fixed MySQL 8.4 startup failure by removing hardcoded `mysql_native_password` authentication [lando/mysql#69](https://github.com/lando/mysql/issues/69) diff --git a/builders/wordpress.js b/builders/wordpress.js index b8fdd38..d18328a 100644 --- a/builders/wordpress.js +++ b/builders/wordpress.js @@ -207,7 +207,7 @@ const getConfigDefaults = options => { const database = _.first(dbConfig.split(':')); const version = _.last(dbConfig.split(':')).substring(0, 2); if (database === 'wordpress-mysql' || database === 'mysql' || database === 'mariadb') { - if (version === '8.') { + if (_.startsWith(version, '8')) { options.defaultFiles.database = 'mysql8.cnf'; } else { options.defaultFiles.database = 'mysql.cnf'; diff --git a/config/mysql8.cnf b/config/mysql8.cnf index 0a8ec42..a8c9e77 100644 --- a/config/mysql8.cnf +++ b/config/mysql8.cnf @@ -48,7 +48,7 @@ read_buffer_size = 2M # other settings you may need to change. #server-id = 1 #log_bin = /src/.lando/log/mysql-bin.log -expire_logs_days = 10 +binlog_expire_logs_seconds = 864000 max_binlog_size = 101M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name diff --git a/examples/wordpress-mysql84/.gitignore b/examples/wordpress-mysql84/.gitignore new file mode 100644 index 0000000..2a083d1 --- /dev/null +++ b/examples/wordpress-mysql84/.gitignore @@ -0,0 +1 @@ +mysql84 diff --git a/examples/wordpress-mysql84/README.md b/examples/wordpress-mysql84/README.md new file mode 100644 index 0000000..263ee53 --- /dev/null +++ b/examples/wordpress-mysql84/README.md @@ -0,0 +1,87 @@ +WordPress MySQL 8.4 Example +=========================== + +This example exists primarily to test the following documentation: + +* [WordPress Recipe](https://docs.devwithlando.io/tutorials/wordpress.html) + +## Start up tests + +Run the following commands to get up and running with this example. + +```bash +# Should poweroff +lando poweroff + +# Should initialize the latest WordPress codebase +rm -rf mysql84 && mkdir -p mysql84 && cd mysql84 +lando init --source remote --remote-url https://wordpress.org/latest.tar.gz --recipe wordpress --webroot wordpress --name lando-wordpress-mysql84 --option database=mysql:8 +cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml + +# Should start up successfully +cd mysql84 +lando start +``` + +## Verification commands + +Run the following commands to validate things are rolling as they should. + +```bash +# Should return the WordPress installation page by default +cd mysql84 +lando exec appserver -- curl -L localhost | grep "WordPress" + +# Should use 8.3 as the default php version +cd mysql84 +lando php -v | grep "PHP 8.3" + +# Should be running apache 2.4 by default +cd mysql84 +lando exec appserver -- apachectl -V | grep 2.4 +lando exec appserver -- curl -IL localhost | grep Server | grep 2.4 + +# Should be running mysql 8.4.x via the mysql:8 alias +cd mysql84 +lando mysql -V | grep '8.4.' + +# Should not enable xdebug by default +cd mysql84 +lando php -m | grep xdebug || echo $? | grep 1 + +# Should use the default database connection info +cd mysql84 +lando mysql -uwordpress -pwordpress wordpress -e quit + +# Should use the default mysql8 config file +cd mysql84 +lando exec database -- cat /opt/bitnami/mysql/conf/my_custom.cnf | grep "LANDOWORDPRESSMYSQL8CNF" +lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep 127 + +# Should use binlog_expire_logs_seconds instead of the removed expire_logs_days +cd mysql84 +lando mysql -u root -e "show variables;" | grep binlog_expire_logs_seconds | grep 864000 + +# Should have the 2.x wp-cli +cd mysql84 +lando wp cli version | grep "WP-CLI 2." + +# Should create a wp-config file +cd mysql84/wordpress +lando wp config create --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --dbhost=database --force + +# Should be able to install wordpress +cd mysql84/wordpress +lando wp core install --url=lando-wordpress.lndo.site --title=LandoPress --admin_user=admin --admin_email=mike@pirog.com --skip-email +``` + +## Destroy tests + +Run the following commands to trash this app like nothing ever happened. + +```bash +# Should be destroyed with success +cd mysql84 +lando destroy -y +lando poweroff +```