Coder Social home page Coder Social logo

mysqld's People

Contributors

chr4 avatar smelchior avatar whitekid avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mysqld's Issues

Test Kitchen issues found on password setting

While coding the percona support, i have added a .kitchen.yml to verify the installations:

On ubuntu 16.04 found this:

run_list:

  • recipe[mysqld::mariadb_repository]
  • recipe[mysqld::default]

And set the root_password attribute:

But password is set on authentication string not on password field, i have accesed this mariadb but the password was not set, solved it using:

mysql --defaults-file=/etc/mysql/debian.cnf mysql -e "UPDATE user SET Password = PASSWORD('abcdef01234567890') WHERE User = 'root'; FLUSH PRIVILEGES;"

I dont know if this happened because using the mariadb.org repository.

Required argument password is missing

I'm trying to use this cookbook with Vagrant, but I can't get it to allow the MySQL user root to have no password. I added cookbook "mysqld" to my Cheffile, and the following to my Vagrantfile:

config.vm.provision "chef_solo" do |chef|
    chef.add_recipe "mysqld"
end

But when I do vagrant up, the Chef configuration fails. Here is the relevant output:

==> default: ================================================================================
==> default: Recipe Compile Error in /tmp/vagrant-chef/82891d35d286774d89cfbe3b7a9ea9d4/cookbooks/mysqld/recipes/default.rb
==> default: ================================================================================
==> default: 
==> default: 
==> default: Chef::Exceptions::ValidationFailed
==> default: ----------------------------------
==> default: Required argument password is missing!
==> default: 
==> default: 
==> default: Cookbook Trace:
==> default: ---------------
==> default:   /tmp/vagrant-chef/82891d35d286774d89cfbe3b7a9ea9d4/cookbooks/mysqld/recipes/configure.rb:26:in `block in from_file'
==> default: 
==> default:   /tmp/vagrant-chef/82891d35d286774d89cfbe3b7a9ea9d4/cookbooks/mysqld/recipes/configure.rb:25:in `from_file'
==> default: 
==> default:   /tmp/vagrant-chef/82891d35d286774d89cfbe3b7a9ea9d4/cookbooks/mysqld/recipes/default.rb:22:in `from_file'
==> default: 
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef/82891d35d286774d89cfbe3b7a9ea9d4/cookbooks/mysqld/recipes/configure.rb:
==> default: 
==> default:  19:  #
==> default:  20:  
==> default:  21:  # Configure mysql/mariadb according to attributes
==> default:  22:  mysqld 'default'
==> default:  23:  
==> default:  24:  # Set password according to attribute, if set
==> default:  25:  mysqld_password 'root' do
==> default:  26>>   password node['mysqld']['root_password']
==> default:  27:    only_if { node['mysqld']['root_password'] }
==> default:  28:  end
==> default:  29:  
==> default:  30:  # Set debian-sys-maint password on Debian family
==> default:  31:  mysqld_password 'debian-sys-maint' do
==> default:  32:    password node['mysqld']['root_password']
==> default:  33:    only_if { node['mysqld']['root_password'] && node['platform_family'] == 'debian' }
==> default:  34:  end
==> default:  35:  
==> default: 
==> default: [2015-03-26T21:29:12+00:00] ERROR: Running exception handlers
==> default: [2015-03-26T21:29:12+00:00] ERROR: Exception handlers complete
==> default: [2015-03-26T21:29:12+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2015-03-26T21:29:12+00:00] ERROR: Required argument password is missing!

The documentation mentions that the root password will be set if given, so I don't see why the argument is required.

Any thoughts?

Debian 8 fails to update password

When using the default mysql (At this time 5.5.52 on debian 8) password doesn't get updated and mysql root user remains without password.

Updating authentication_string has no effect on this version. Searching over the web found the following:

MySQL 5.7.5 and earlier version:
SET PASSWORD FOR 'user_name' = PASSWORD('new_password');

MySQL 5.7.6 and later version:
alter user 'user_name' identified by 'new_password';

Also, the execution of the query fails with a "no database selected". fixed on a copy of the cookbook locally, but also the authentication_string also was of no effect to change the password.

Setting 'service_name' fails to change the service name defined in providers/default.rb

When trying to use this cookbook and changing the node.default['mysqld']['service_name'] value, I get the following error

==> db: ================================================================================
==> db: Error executing action restart on resource 'service[mysql]'
==> db: ================================================================================
==> db:
==> db: Mixlib::ShellOut::ShellCommandFailed
==> db: ------------------------------------
==> db: Expected process to exit with [0], but received '5'
==> db: ---- Begin output of /bin/systemctl restart mysql ----
==> db: STDOUT:
==> db: STDERR: Failed to restart mysql.service: Unit not found.
==> db: ---- End output of /bin/systemctl restart mysql ----
==> db: Ran /bin/systemctl restart mysql returned 5
==> db:
==> db: Resource Declaration:
==> db: ---------------------
==> db: # In /tmp/vagrant-chef/824d535e25710db30ed17d906f18aa01/cookbooks/mysqld/providers/default.rb
==> db:
==> db: 48: service new_resource.service_name do
==> db: 49: # Use --wsrep-new-cluster if this is an initial galera startup
==> db: 50: if new_resource.galera_init
==> db: 51: start_command "service #{new_resource.service_name} start --wsrep-new-cluster --wsrep_cluster_address=gcomm://"
==> db: 52: end
==> db: 53:
==> db:
==> db: Compiled Resource:
==> db: ------------------
==> db: # Declared in /tmp/vagrant-chef/824d535e25710db30ed17d906f18aa01/cookbooks/mysqld/providers/default.rb:48:in `block in class_from_file'
==> db:
==> db: service("mysql") do
==> db: action [:enable, :start]
==> db: supports {:restart=>nil, :reload=>nil, :status=>nil}
==> db: retries 0
==> db: retry_delay 2
==> db: default_guard_interpreter :default
==> db: service_name "mysql"
==> db: pattern "mysql"
==> db: declared_type :service
==> db: cookbook_name :mysqld
==> db: not_if { #code block }
==> db: end

It looks as though the service name is still "mysql" instead of the value I pass through as node.default['mysqld']['service_name'] - in this instance, "mysqld"

Using chef 13 the cookbook doesn't converge due to modification of inmutable properties

Description

In Chef Client 13 some types of resource properties became immutable, including Hash.

========================================================
Error executing action create on resource 'mysqld[default]'

       RuntimeError
       ------------
       can't modify frozen Hash

       Cookbook Trace:
       ---------------
       /tmp/kitchen/cache/cookbooks/mysqld/providers/default.rb:23:in `block in class_from_file'

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/mysqld/recipes/configure.rb

        22: mysqld 'default'
        23:

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/mysqld/recipes/configure.rb:22:in `from_file'

       mysqld("default") do
         action [:create]
         default_guard_interpreter :default
         declared_type :mysqld
         cookbook_name "mysqld"
         recipe_name "configure"
       end

       System Info:
       ------------
       chef_version=13.2.20
       platform=ubuntu
       platform_version=16.04
       ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
       program_name=chef-client worker: ppid=1615;start=13:23:26;
       executable=/opt/chef/bin/chef-client

Percona support

If it's interesting, i can make a pull request with support for percona, like mariadb.

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.