Skip to content

Instantly share code, notes, and snippets.

@meorajrul
Last active May 31, 2024 16:14
Show Gist options
  • Save meorajrul/b57803bf1b4ddfd2f93e6ad37c3ac5f2 to your computer and use it in GitHub Desktop.
Save meorajrul/b57803bf1b4ddfd2f93e6ad37c3ac5f2 to your computer and use it in GitHub Desktop.
Laragon Multiple MySQL Database Version Setup

Pre-requisite

  1. Laragon
  2. Multiple DB are ready to install (look table below)
  3. Unzip tools like 7zip or Winrar
  4. Laragon installation path default is C:\laragon\, might be different depending on where you install this. However we will focus on laragon mysql directory folder which located on C:\laragon\bin\mysql

If you look at Laragon documentation on multiple DB it should be straight forward however i would like to make it as painless as possible with the setup

By default Laragon (Full version) comes with MySQL 8.0.* version. However we will install latest or older version of MySQL show how we switch to one another using Laragon system tray mysql version switch feature.

2

For this context we will use MySQL community ZIP version that does not have any debugging binary and test suite (keep the size down)

MySQL Version Download Path Local Data Path
5.7.44 Link C:\laragon\data\mysql
8.0.* (Default) N/A C:\laragon\data\mysql-8
8.4 LTS Link C:\laragon\data\mysql-8.4

Steps for MySQL 8.4

  1. Download and unzip the file to C:\laragon\bin\mysql. Your folder structure should look like this after extract. image
  2. Open command line using CMDer (default terminal by Laragon) and run:
cd C:\laragon\bin\mysql\mysql-8.4.0-winx64\bin
mysqld --initialize --datadir="C:\laragon\data\mysql-8.4" --basedir="C:\laragon\bin\mysql\mysql-8.4.0-winx64" --console

2-mysql init

Make sure to store those password generated in the terminal for later use. We will use it to reset root password when we start to login via HeidiSQL

  1. Copy my.ini (mysqld config) below to mysql 8.4 base folder and set it as read-only (to avoid Laragon override setting using old template)

3-1

  1. Right click on Laragon Tray and switch to MySQL 8.4 version

2-1

  1. Start services

4 5-laragon-started

  1. Open HeidiSQL or any of your DB IDEs and start accessing the table. After first login with root username and generated password, HeidiSQL will ask for new password. Key-in your desirable new password and your are done.

6-mysql password reset

[client]
#password=your_password
port=3306
socket=/tmp/mysql.sock
[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=256M
max_allowed_packet=512M
table_open_cache=256
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=4M
myisam_sort_buffer_size=64M
thread_cache_size=8
secure-file-priv=""
explicit_defaults_for_timestamp=1
datadir= "C:/laragon/data/mysql-8.4"
basedir= "C:/laragon/bin/mysql/mysql-8.4.0-winx64"
#default_authentication_plugin=mysql_native_password
[mysqldump]
quick
max_allowed_packet=512M
@odysahe
Copy link

odysahe commented Nov 29, 2023

Work, Thanks..

@ThuretGbenougan
Copy link

Capture d'écran 2024-02-05 095052

Hello, i have this error when il try. Help me

@surajkhanal
Copy link

Facing issue

image

2024-05-03T14:42:40.572669Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-05-03T14:42:40.832056Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2024-05-03T14:42:40.832208Z 0 [System] [MY-010116] [Server] C:\laragon\bin\mysql\mysql-8.4.0-winx64\bin\mysqld (mysqld 8.4.0) starting as process 3964
2024-05-03T14:42:40.892762Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-03T14:42:41.482975Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Table 'mysql.plugin' doesn't exist
2024-05-03T14:42:41.854200Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2024-05-03T14:42:41.856947Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:41.858783Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:41.860643Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:41.862729Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:41.864896Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:41.867017Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:41.869074Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:41.993820Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-05-03T14:42:42.083159Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-05-03T14:42:42.106371Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-05-03T14:42:42.107295Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-05-03T14:42:42.117450Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:42.119440Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
2024-05-03T14:42:42.122000Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
2024-05-03T14:42:42.128627Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default_authentication_plugin=caching_sha2_password'.
2024-05-03T14:42:42.133142Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-03T14:42:43.102182Z 0 [System] [MY-010910] [Server] C:\laragon\bin\mysql\mysql-8.4.0-winx64\bin\mysqld: Shutdown complete (mysqld 8.4.0)  MySQL Community Server - GPL.
2024-05-03T14:42:43.103844Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2024-05-03T14:42:50.584806Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-05-03T14:42:50.793034Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2024-05-03T14:42:50.793120Z 0 [System] [MY-010116] [Server] C:\laragon\bin\mysql\mysql-8.4.0-winx64\bin\mysqld (mysqld 8.4.0) starting as process 20412
2024-05-03T14:42:50.830941Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-03T14:42:51.435698Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Table 'mysql.plugin' doesn't exist
2024-05-03T14:42:51.787744Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2024-05-03T14:42:51.789434Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:51.790783Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:51.792036Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:51.793353Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:51.794561Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:51.795781Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:51.797010Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:51.957602Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-05-03T14:42:52.055098Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-05-03T14:42:52.076750Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-05-03T14:42:52.077870Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-05-03T14:42:52.087809Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-05-03T14:42:52.089792Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
2024-05-03T14:42:52.093070Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
2024-05-03T14:42:52.101112Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default_authentication_plugin=caching_sha2_password'.
2024-05-03T14:42:52.106723Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-03T14:42:53.248088Z 0 [System] [MY-010910] [Server] C:\laragon\bin\mysql\mysql-8.4.0-winx64\bin\mysqld: Shutdown complete (mysqld 8.4.0)  MySQL Community Server - GPL.
2024-05-03T14:42:53.250485Z 0 [System] [MY-015016] [Server] MySQL Server - end.

@TiagoSilvaPereira
Copy link

@surajkhanal same issue here!!

@meorajrul
Copy link
Author

meorajrul commented May 10, 2024

Hi @ThuretGbenougan and @TiagoSilvaPereira , in the new release of mysql 8.4 they pretty much broke how mysql is setup in Laragon. Reason as follows:

  1. The ability to use plain password is removed in MySQL https://dev.mysql.com/doc/refman/8.4/en/server-options.html#option_mysqld_mysql-native-password
  2. How Laragon initiate new database for every new version are hardcoded in the program using old 8.0 template.

I have update accordingly but it require some setup to be configured on your side

@TiagoSilvaPereira
Copy link

Thanks @meorajrul I'll try with 8.3

@Maaz0313
Copy link

Maaz0313 commented May 20, 2024

Worked for me. Thanks @meorajrul
Make sure that you use libmariadb.dll when logging in with temporary password.

@willeumanuel
Copy link

I followed all of @meorajrul instructions, and Laragon is running MySQL 8.4.
Here's a photo to prove it.
imagem

But, I think that the creator of Laragon has to review this inconsistency, because new users, when trying to install a MySQL version different from the original one in which Laragon 6 is configured, will have to scour the Internet and even come across this help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment