JarJarBernie / jimmybox

Web developer box with multiple PHP Versions
42 stars 15 forks source link

Suggestions: MySQL 8 support and readme extension #6

Open CunningFatalist opened 3 years ago

CunningFatalist commented 3 years ago

Servus and hello,

first of all, thanks for sharing your Vagrant box. At betterbusiness GmbH, we use it for several Symfony projects, and I use it for personal PHP projects as well.

I have some suggestions that may improve your box even further 😃

1. Add MySQL 8 support

We are currently using the following solution, which is a little hacky. I will still share it so that others can use it as well. We created a provision/setup/mysql.sh with the following contents:

#!/bin/sh

# MySQL Setups
####################################################################

# Remove previous MySQL versions
####################################################################

export DEBIAN_FRONTEND=noninteractive

sudo systemctl stop mysql
sudo apt-get remove mysql-* -y

sudo dpkg --configure -a
sudo -E apt-get purge mysql-*
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql

sudo apt-get autoremove
sudo apt-get autoclean

# Install MySQL 8.0
####################################################################

sudo apt-get update
sudo apt install mysql-server-8.0 -o Dpkg::Options::="--force-confnew" -y

# Enable native password authentication
# Otherwise you would have to open MySQL as root `sudo mysql -u root`.
# This, on the other hand, allows you to use `mysql -uroot -proot`.
####################################################################

echo "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; FLUSH PRIVILEGES;" | sudo mysql -u root

You can also add this to your readme if you would like to. But as I said, it is a little hacky.

2. Add Symfony to the list of technologies in your readme

As I already mentioned, we use this box for Symfony projects, and it works very well. Adding this to your readme will help users to find your box with search engines.

Cheers from Berlin

JarJarBernie commented 3 years ago

@CunningFatalist Servus Stefan!

Thank you for your kind feedback and for sharing your MySQL 8.0 solution which looks smart to me ;-) I have tested it in my default environment and can confirm that it worked perfectly there.

Existing databases were deleted during the update. It should be clear, but I wanted to mention it for other users.

I will do some further testing and include a MySQL 8 solution in the next release.

Cheers from Mondsee / Austria

Bernie

P.S.: Cool that it works good with Symfony, i will mention this in the Readme.md.

CunningFatalist commented 2 years ago

Hey,

I would like to drop a warning for those who want to use the script above. It works with Jimmybox 3.1.0, but not with 3.2.0. I do not know why and since we do not use PHP 8.1 at our company yet, I will not put any effort into this and simply use 3.1.0.

Cheers

CunningFatalist commented 2 years ago

Hello again

If anyone would like to use PHP 8.1 and Jimmybox 3.2.0, we have fixed the above script. The issue was this line:

sudo apt install mysql-server-8.0 -o Dpkg::Options::="--force-confnew" -y

You have to change it to:

sudo apt-get install mysql-server-8.0 -o Dpkg::Options::="--force-confnew" -y

Here's the explanation, if you want to know more.