jakubboucek/lamp-devstack-mysql

By jakubboucek

Updated 5 days ago

Images for local development in LAMP devstack (MySQL)

Image
Databases & storage
2

5.5K

jakubboucek/lamp-devstack-mysql repository overview

LAMP devstack Docker images (MySQL part)

Images for local development in LAMP devstack

Main features

  • architecture: linux/amd64
  • current versions of MariaDB 12.1, 11.8, 11.4, 10.11, 10.6 and RC pre-release of 12.2
  • unsupported versions of MariaDB 12.0, 11.7, 11.6, 11.5, 11.3, 11.2, 11.1, 11.0, 10.10, 10.9, 10.8, 10.7, 10.5, 10.4 and 10.3 (unmaintained)
  • MySQL properly configured to use utf8mb4 as a default charset, an optional support of Windows Host is also available
Using MySQL

MySQL server starts at the same time as the web server.

Available MySQL images:

  • 10.6: jakubboucek/lamp-devstack-mysql:10.6
  • 10.11: jakubboucek/lamp-devstack-mysql:10.11
  • 11.4: jakubboucek/lamp-devstack-mysql:11.4
  • 11.8: jakubboucek/lamp-devstack-mysql:11.8
  • 12.1: jakubboucek/lamp-devstack-mysql:latest

LTS (long-term support) MySQL images (currently 11.8):

  • jakubboucek/lamp-devstack-mysql:lts

The RC pre-release of MySQL 12.2 images have the -rc suffix, example:

  • jakubboucek/lamp-devstack-mysql:12.2-rc
  • jakubboucek/lamp-devstack-mysql:12.2-1-rc

Default credentials:

  • user: root
  • password: devstack
  • database name: default

From Host, MySQL is accessible using:

  • host: 127.0.0.1
  • port: 33060

From docker guest, MySQL is accessible using:

  • host: mysqldb
  • port: 3306

If you are connecting to the MySQL server from a PHP application running inside Docker, use the docker guest access values, but when you're connecting from outside (for example, from your computer, using HeidiSQL or Sequel), use host access.

PHP example:

$pdo = new PDO('mysql:host=mysqldb;dbname=default;charset=utf8mb4', 'root', 'devstack');
// or
$mysqli = new mysqli('mysqldb', 'root', 'devstack', 'default');
$mysqli->set_charset('utf8mb4');
Windows issue

MySQL may crash when Host is running Windows:

The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file

You can try to fix it by adding mysql-windows.cnf (download) and add it to the MySQL config directory /etc/mysql/conf.d/ inside the Docker container.

In docker-compose.yml file, just link this downloaded file to volume section:

volumes:
    - "./.docker/mysql/data:/var/lib/mysql"
    - "./mysql-windows.cnf:/etc/mysql/conf.d/mysql-windows.cnf"

Extended configuration

Timezone

The default timezone is not defined (UTC will be used). You can modify the default timezone by setting the TZ environment variable to the desired timezone name (e.g., Europe/Prague).

It can also be specified directly with docker run:

docker run -it --rm -e TZ=Europe/Prague jakubboucek/lamp-devstack-mysql

Or in your docker-compose.yml file:

environment:
    TZ: Europe/Prague

The TZ environment variable is recognized by Linux tools as well. By creating the variable you modify the default timezone for the whole Linux operating system and also MySQL.

Tag summary

Content type

Image

Digest

sha256:cfde869f5

Size

104.4 MB

Last updated

5 days ago

Requires Docker Desktop 4.37.1 or later.