Git Product home page Git Product logo

mariadb's Introduction

MariaDB Lando Plugin

This is the official Lando plugin for MariaDB. When installed it...

  • Allows users to run various mariadb versions

Of course, once a user is running their MariaDB project with Lando they can take advantage of all the other awesome development features Lando provides.

Basic Usage

Add a mariadb service to your Landofile

services:
  myservice:
    type: mariadb

For more info you should check out the docs:

Issues, Questions and Support

If you have a question or would like some community support we recommend you join us on Slack.

If you'd like to report a bug or submit a feature request then please use the issue queue in this repo.

Changelog

We try to log all changes big and small in both THE CHANGELOG and the release notes.

Maintainers

Contributors

Made with contributors-img.

Other Selected Resources

mariadb's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar kaszarobert avatar pirog avatar reynoldsalec avatar rtfm-47 avatar rubenvarela avatar uberhacker avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mariadb's Issues

Mariadb is very slow with large database compared to mysql (Drupal 8)

  • Windows 11
  • Ubuntu 22.04.1 LTS (WSL)
  • Lando 3.6.4
  • Docker 20.10.21
  • Drupal 8 (composer)

I have also try with Ubuntu 22.04 (direct install into a fresh computer) and i have the same problem.

Mariadb is very very slow with large database (more than 5gb) and my website is currently unusable.

My .lando.yml :

name: mywebsitename
recipe: drupal8
excludes:
  - dump
config:
  php: "7.3"
  drush: "*"
  via: nginx
  webroot: web
  database: mariadb:10.4
  composer_version: "1.10.17"

If i replace mariadb by mysql :
My .lando.yml :

name: mywebsitename
recipe: drupal8
excludes:
  - dump
config:
  php: "7.3"
  drush: "*"
  via: nginx
  webroot: web
  database: mysql
  composer_version: "1.10.17"

i didn't have any problem with mysql and my website is very fast.

Any idea about this bug with mariadb ?

MariaDB 11 deprecates mysqldump, need an option to use else in lando db-export and lando db-import scripts

If you force Lando to use image bitnami/mariadb:11.0.5-debian-12-r5 for database service, running lando db-export and lando db-import shows this on CLI:

pc@ASUS-PC:~/lando-projects/drupal2.localhost$ lando db-export 1100.sql
Preparing to export /app/1100.sql from database 'drupal2' on service 'database' as user root...
mysqldump: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb-dump' instead
Success /app/1100.sql.gz was created!

pc@ASUS-PC:~/lando-projects/drupal2.localhost$ lando db-import 1100.sql.gz
Preparing to import /app/1100.sql.gz into database 'drupal2' on service 'database' as user root...

Emptying drupal2...
NOTE: See the --no-wipe flag to avoid this step!
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Dropping batch from drupal2 database...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Dropping block_content from drupal2 database...
...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Dropping watchdog from drupal2 database...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Gzipped file detected!
Importing /app/1100.sql.gz...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Import complete!

It runs fine right now, you just meet with deprecation messages. But in the future it could no longer work for MariaDB, so we need a way to switch to '/opt/bitnami/mariadb/bin/mariadb-dump' instead for MariaDB 11+.

MariaDB 10.6: can't connect to the database after rebuild from MariaDB 10.4

After a rebuild to switch to MariaDB 10.6 from MaraiDB 10.4, the website can't connect to the database.

When I run lando info, I see that the credentials are correct and that the service is healty.

I got the following error once after a rebuild:
ERROR ==> ERROR 2002 (HY000): Can't connect to local server through socket '/opt/bitnami/mariadb/tmp/mysql.sock

Docker logs

2023-12-18 12:08:43 
2023-12-18 12:08:43 
2023-12-18 12:08:43 
2023-12-18 12:08:43                          STARTING UP                            
2023-12-18 12:08:43 
2023-12-18 12:08:43          ██       █████  ███    ██ ██████   ██████             
2023-12-18 12:08:43          ██      ██   ██ ████   ██ ██   ██ ██    ██            
2023-12-18 12:08:43          ██      ███████ ██ ██  ██ ██   ██ ██    ██            
2023-12-18 12:08:43          ██      ██   ██ ██  ██ ██ ██   ██ ██    ██            
2023-12-18 12:08:43          ███████ ██   ██ ██   ████ ██████   ██████             
2023-12-18 12:08:43 
2023-12-18 12:08:43        The best local development tool in the galaxy!          
2023-12-18 12:08:43 
2023-12-18 12:08:43 
2023-12-18 12:08:43 ===============================================================
2023-12-18 12:08:43 
2023-12-18 12:08:43 
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] InnoDB: Number of pools: 1
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] mysqld: O_TMPFILE is not supported on /opt/bitnami/mariadb/tmp (disabling future attempts)
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] InnoDB: Using Linux native AIO
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] InnoDB: Completed initialization of buffer pool
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.17.
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] InnoDB: Starting shutdown...
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [ERROR] Aborting
2023-12-18 12:08:43 userperms 11:08:43.32 WARN  ==> Only the root user can reset permissions! This is probably ok though...
2023-12-18 12:08:43 loadkeys 11:08:43.43 WARN  ==> Only the root user can load ssh keys! This is probably ok though...
2023-12-18 12:08:43 lando 11:08:43.43 INFO  ==> Lando handing off to: /launch.sh
2023-12-18 12:08:43 lando 11:08:43.44 DEBUG ==> Running command with exec...
2023-12-18 12:08:43 mariadb 11:08:43.51 
2023-12-18 12:08:43 mariadb 11:08:43.52 Welcome to the Bitnami mariadb container
2023-12-18 12:08:43 mariadb 11:08:43.52 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mariadb
2023-12-18 12:08:43 mariadb 11:08:43.53 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mariadb/issues
2023-12-18 12:08:43 mariadb 11:08:43.53 
2023-12-18 12:08:43 mariadb 11:08:43.53 INFO  ==> ** Starting MariaDB setup **
2023-12-18 12:08:43 mariadb 11:08:43.63 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
2023-12-18 12:08:43 mariadb 11:08:43.63 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
2023-12-18 12:08:43 mariadb 11:08:43.65 INFO  ==> Initializing mariadb database
2023-12-18 12:08:43 mariadb 11:08:43.66 DEBUG ==> Ensuring expected directories/files exist
2023-12-18 12:08:43 mariadb 11:08:43.72 INFO  ==> Updating 'my.cnf' with custom configuration
2023-12-18 12:08:43 mariadb 11:08:43.74 DEBUG ==> Injecting custom configuration from my_custom.conf
2023-12-18 12:08:43 mariadb 11:08:43.75 INFO  ==> Setting user option
2023-12-18 12:08:43 mariadb 11:08:43.76 DEBUG ==> Setting user to 'wordpress' in mariadb configuration file /opt/bitnami/mariadb/conf/my.cnf
2023-12-18 12:08:43 mariadb 11:08:43.79 INFO  ==> Injecting custom configuration 'my_custom.cnf'
2023-12-18 12:08:43 mariadb 11:08:43.79 INFO  ==> Using persisted data
2023-12-18 12:08:43 mariadb 11:08:43.87 INFO  ==> Running mysql_upgrade
2023-12-18 12:08:43 mariadb 11:08:43.88 INFO  ==> Starting mariadb in background
2023-12-18 12:08:44 2023-12-18 11:08:44 0 [Note] /opt/bitnami/mariadb/sbin/mysqld (server 10.6.5-MariaDB) starting as process 74 ...

I tried the following operations:

  1. db-export
  2. rebuild
  3. db-import

After that, the connection to the database worked again.

Context

  • Lando v3.20.8
  • Docker v24.0.7
  • WordPress recipe with default configuration for MariaDB

Update MariaDB Across All Recipes

We've added new MariaDB versions, to get these changes to THE PEOPLE we need to update the version of MariaDB across all the recipes that use it. Specifically...

  • Acquia
  • Backdrop
  • Drupal
  • Joomla
  • Laravel
  • Pantheon
  • WordPress
  • LAMP
  • LEMP

This will involve...

  • Updating the dependencies: npm install @lando/[email protected]
  • Updating the docs if they mention available versions of Mariadb
  • Adding a test for the new version. This may be as simple as adding the new version to the custom example that most of these repos will have...in most cases it doesn't make sense to add a whole new dir to the examples directory just for a MariaDB update, but adding another service (or editing an existing service) in a custom example to use the newest version of MariaDB available could be smart so we're testing the "frontier" of MariaDB.
  • Updating the CHANGELOG

Better Healthcheck Testing/Blank dbname/user Testing

We just implemented a fix to handle situations where the user specifies blank dbname/password/username for the db config. Ex:

services:
  database:
    type: mariadb
      creds:
        user: customusername
        password:
        database: customdbname

The fix: 017dba9

I put in a "test case" in the custom example to make sure a blank password wouldn't fail the healthcheck or otherwise create problems, however, I'm not testing blank user or database values. From some quick manual testing it looked like those worked ok, but would be good to explicitly test this.

Version mismatch documentation vs code

In #45, the documentation of the MR specifies 11.3 as the highest version. In the code of the MR I only see 11.2.

Changes here, https://github.com/lando/mariadb/pull/45/files

From main,

supported: ['11.2', '11.1', '11.0', '10.11', '10.10', '10.9', '10.8',
'10.7', '10.6', '10.5', '10.4', '10.3', '10.2', '10.1'],

mariadb/docs/index.md

Lines 19 to 22 in 49f1cad

## Supported versions
* [11.3](https://hub.docker.com/r/bitnami/mariadb)
* [11.2](https://hub.docker.com/r/bitnami/mariadb)

Fast backup

I'm working on this custom tooling that can do backup super quick. In sql size I have about 1.8 GB file and it takes about 4 minutes to import file with lando db-import .

With the new way, it takes 9.3 seconds... but it needs to restart database container and I don't know how. Only way to restart it atm is restarting Lando which make the total database restoration 9.3+21=30.3 seconds.

This is PR I'm working on wunderio/lando-drupal#45 (It's PR in our custom Composer package do ship .lando.base.yml file together with some scripts. ) But as you can see from the PR, it's quite straight-forward setup.

  1. Is there way to restart db? In the PR I did try something but I don't know how to start it again?
  2. Could you implement this into Lando? This seems be be one big advantage of DDEV atm over Lando.

Warnings when performing MySQL commands on mariadb:10.6

Steps to reproduce:

  • import database on mariadb 10.6.x in lando

Result:
I received a whole lot of: WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol.

Cause:
If hostname is not specified or hostname is localhost, then Unix sockets are used.
In other cases (hostname is given and it's not localhost) then a TCP/IP connection through the port option is used.
Note that localhost is a special value. Using 127.0.0.1 is not the same thing. The latter will connect to the mysqld server through TCP/IP.

Solution:
Change the Host from localhost to 127.0.0.1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.