# Opscode MySQL cookbook

**URL:** <https://discourse.chef.io/t/opscode-mysql-cookbook/1405>\
**Category:** Chef Infra (archive)\
**Created:** [April 30, 2010, 11:12am UTC](https://discourse.chef.io/t/opscode-mysql-cookbook/1405 "2010-04-30T11:12:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Wood](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jon_wood/32/826_2.png) [@Jon\_Wood](https://discourse.chef.io/u/Jon_Wood)\
**Post date:** [April 30, 2010, 11:12am UTC](https://discourse.chef.io/t/opscode-mysql-cookbook/1405/1 "2010-04-30T11:12:01Z")

</div>

Hi,

I’m trying to set up an application to deploy using Chef, and I’m  
having some trouble with the MySQL cookbook from the Opscode  
repository when including the mysql::client recipe on first run. The  
client recipe has the following running under Ubuntu:

gem\_package “mysql” do  
action :nothing  
end

r.run\_action(:install)

That fails on the first run using my base image, because at the point  
that the cookbook gets loaded and attempts to install the mysql gem I  
don’t have ruby1.8-dev installed yet. The ruby cookbook is being  
included in a default role applied to all nodes, but doesn’t get a  
chance to run in time.

Is there a particular reason for forcing both the gem and mysql-devel  
to be installed immediately, rather then respecting my run list’s  
order?

Cheers,  
Jon

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [May 3, 2010, 6:19am UTC](https://discourse.chef.io/t/opscode-mysql-cookbook/1405/2 "2010-05-03T06:19:16Z")

</div>

Hi Jon,  
As you probably know, the "run\_action hack" is usually used to install  
a gem and then use it later in the recipe. In this case, it doesn't  
look like we're taking advantage of this any more. You can see that  
the cookbook provides LWRP for flushing and unlocking MySQL tables,  
but they don't appear to be used in the recipe itself.

Feel free to file a bug or submit a patch.

Dan DeLeo

On Fri, Apr 30, 2010 at 4:12 AM, Jon Wood [jon@blankpad.net](mailto:jon@blankpad.net) wrote:

> Hi,
> 
> I'm trying to set up an application to deploy using Chef, and I'm  
> having some trouble with the MySQL cookbook from the Opscode  
> repository when including the mysql::client recipe on first run. The  
> client recipe has the following running under Ubuntu:
> 
> gem\_package "mysql" do  
> action :nothing  
> end
> 
> r.run\_action(:install)
> 
> That fails on the first run using my base image, because at the point  
> that the cookbook gets loaded and attempts to install the mysql gem I  
> don't have ruby1.8-dev installed yet. The ruby cookbook is being  
> included in a default role applied to all nodes, but doesn't get a  
> chance to run in time.
> 
> Is there a particular reason for forcing both the gem and mysql-devel  
> to be installed immediately, rather then respecting my run list's  
> order?
> 
> Cheers,  
> Jon

---

<div class="post-metadata">

**Author:** ![Jon\_Wood](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jon_wood/32/826_2.png) [@Jon\_Wood](https://discourse.chef.io/u/Jon_Wood)\
**Post date:** [May 4, 2010, 9:56am UTC](https://discourse.chef.io/t/opscode-mysql-cookbook/1405/3 "2010-05-04T09:56:17Z")

</div>

Thanks Dan,

I don't seem to be able to connect to [tickets.opscode.com](http://tickets.opscode.com) right now,  
but once I can I'll submit a patch to change that behaviour.

Jon

On 3 May 2010 07:19, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> Hi Jon,  
> As you probably know, the "run\_action hack" is usually used to install  
> a gem and then use it later in the recipe. In this case, it doesn't  
> look like we're taking advantage of this any more. You can see that  
> the cookbook provides LWRP for flushing and unlocking MySQL tables,  
> but they don't appear to be used in the recipe itself.
> 
> Feel free to file a bug or submit a patch.
> 
> Dan DeLeo
> 
> On Fri, Apr 30, 2010 at 4:12 AM, Jon Wood [jon@blankpad.net](mailto:jon@blankpad.net) wrote:
> 
> > Hi,
> > 
> > I'm trying to set up an application to deploy using Chef, and I'm  
> > having some trouble with the MySQL cookbook from the Opscode  
> > repository when including the mysql::client recipe on first run. The  
> > client recipe has the following running under Ubuntu:
> > 
> > gem\_package "mysql" do  
> > action :nothing  
> > end
> > 
> > r.run\_action(:install)
> > 
> > That fails on the first run using my base image, because at the point  
> > that the cookbook gets loaded and attempts to install the mysql gem I  
> > don't have ruby1.8-dev installed yet. The ruby cookbook is being  
> > included in a default role applied to all nodes, but doesn't get a  
> > chance to run in time.
> > 
> > Is there a particular reason for forcing both the gem and mysql-devel  
> > to be installed immediately, rather then respecting my run list's  
> > order?
> > 
> > Cheers,  
> > Jon
