sous-chefs / mysql

Development repository for the mysql cookbook

Home Page:https://supermarket.chef.io/cookbooks/mysql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQL 8 support

heaven opened this issue · comments

Is there any way to install MySQL 8 currently using this cookbook?

I tried adding this to my recipe:

remote_file "#{Chef::Config['file_cache_path']}/mysql-apt-config_0.8.14-1_all.deb" do
  source "https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb"
  mode 0644
end

dpkg_package "mysql-apt-config_0.8.14-1_all.deb" do
  source "#{Chef::Config['file_cache_path']}/mysql-apt-config_0.8.14-1_all.deb"
  action :install
  notifies :run, 'execute[apt-get update]', :immediately
end

And got the following issues:

  1. An issue with the apparmor config update. Resolved by manually running apt-get install mysql-community-server, which runs a UI using ncurses (probably could be resolved somehow, but not sure how yet).
    Configuration file '/etc/apparmor.d/usr.sbin.mysqld'
     ==> Deleted (by you or by a script) since installation.
     ==> Package distributor has shipped an updated version.
       What would you like to do about it ?  Your options are:
        Y or I  : install the package maintainer's version
        N or O  : keep your currently-installed version
          D     : show the differences between the versions
          Z     : start a shell to examine the situation
     The default action is to keep your current version.
    *** usr.sbin.mysqld (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package mysql-community-server (--configure):
     end of file on stdin at conffile prompt
    Processing triggers for libc-bin (2.23-0ubuntu11) ...
    Errors were encountered while processing:
     mysql-community-server
    STDERR: E: Sub-process /usr/bin/dpkg returned an error code (1)
    ---- End output of ["apt-get", "-q", "-y", "install", "mysql-community-server=8.0.18-1ubuntu16.04"] ----
    Ran ["apt-get", "-q", "-y", "install", "mysql-community-server=8.0.18-1ubuntu16.04"] returned 100
  1. An issue with the initial DB setup (doesn't find the system users table and tries to remove the whole data directory (!)). Luckily thid didn't work.
================================================================================
        Error executing action `run` on resource 'bash[replica initial records]'
        ================================================================================

        Mixlib::ShellOut::ShellCommandFailed
        ------------------------------------
        Expected process to exit with [0, 1, 2], but received '127'
        ---- Begin output of "bash"  "/tmp/chef-script20191210-8496-1hmgg6v" ----
        STDOUT:
        STDERR: /tmp/chef-script20191210-8496-1hmgg6v: line 12: mysql_install_db: command not found
        ---- End output of "bash"  "/tmp/chef-script20191210-8496-1hmgg6v" ----
        Ran "bash"  "/tmp/chef-script20191210-8496-1hmgg6v" returned 127

        Resource Declaration:
        ---------------------
        # In /var/chef/cache/cookbooks/mysql/libraries/mysql_service_base.rb

         91:         bash "#{new_resource.name} initial records" do
         92:           code init_records_script
         93:           umask '022'
         94:           returns [0, 1, 2] # facepalm
         95:           not_if "/usr/bin/test -f #{new_resource.data_dir}/mysql/user.frm"
         96:           action :run
         97:         end
         98:       end

Is there any timeline on when mysql 8.0 support will be added?

I've been working on doing the similar thing in the percona cookbook. I'll likely take a look at cleaning up tests/etc in this cookbook next. Maybe a week or two?

Awesome! Thanks for the update.

@ramereth do you have any new updates?

@unibeck I have @EMH333 working on this and should have a PR for this soon I think

MySQL 8 support has been released with the version 9 of this cookbook