<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="https://build2be.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>build2be/com/e - mysql</title>
 <link>https://build2be.com/category/mysql</link>
 <description></description>
 <language>en</language>
<item>
 <title>Homebrew installed MariaDb too many open files</title>
 <link>https://build2be.com/content/homebrew-installed-mariadb-too-many-open-files</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;h3&gt;MariaDB broken&lt;/h3&gt;

&lt;p&gt;It &lt;a href=&quot;/node/177&quot;&gt;happened again&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I did &lt;code&gt;brew update/upgrade&lt;/code&gt; a while ago then weeks after that restarted MariaDB then days later tried to access MariaDB.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;MariaDb too many open files&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Trying to get info over the config file seems not easy.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Fri, 13 Nov 2020 08:08:44 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">208 at https://build2be.com</guid>
 <comments>https://build2be.com/content/homebrew-installed-mariadb-too-many-open-files#comments</comments>
</item>
<item>
 <title>Updating mysql for Drupal 8</title>
 <link>https://build2be.com/content/updating-mysql-drupal-8</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;As Drupal 8 now required a mysql version higher then my current manually installed version 5.1.46 released on April 23, 2010 I have to try yo get rid of that version and install the latest through homebrew.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Sun, 10 May 2015 16:05:48 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">177 at https://build2be.com</guid>
 <comments>https://build2be.com/content/updating-mysql-drupal-8#comments</comments>
</item>
<item>
 <title>Who is currently online</title>
 <link>https://build2be.com/content/who-currently-online</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;I want to run &lt;code&gt;svn up&lt;/code&gt; on the site but I need to offline it first. So who is online?&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;SELECT name, mail, (unix_timestamp()-access)/3600 AS hours
&amp;nbsp; FROM users
&amp;nbsp; HAVING hours &amp;lt; 1
&amp;nbsp; ORDER BY access;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or for short&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;drush sql-query &quot;select name, mail, (unix_timestamp()-access)/3600 as hours from users having hours &amp;lt; 1 order by access;&quot;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 13 Jan 2011 10:06:26 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">109 at https://build2be.com</guid>
 <comments>https://build2be.com/content/who-currently-online#comments</comments>
</item>
<item>
 <title>mysql on mac</title>
 <link>https://build2be.com/content/mysql-mac</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;(this is my scratchpad)&lt;br /&gt;
I installed mysql on a mac straight from mysql website. Not sure whether that was a wise decision.&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
vi /etc/my.cnf 
/Library/StartupItems/MySQLCOM/MySQLCOM stop
/Library/StartupItems/MySQLCOM/MySQLCOM start&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Resources:&lt;br /&gt;&lt;a href=&quot;http://www.jonmaddox.com/2007/10/27/start-and-stop-mysql-in-mac-os-x-105-leopard/&quot;&gt;http://www.jonmaddox.com/2007/10/27/start-and-stop-mysql-in-mac-os-x-105...&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://stackoverflow.com/questions/93128/mysql-got-a-packet-bigger-than-max-allowed-packet-bytes&quot;&gt;http://stackoverflow.com/questions/93128/mysql-got-a-packet-bigger-than-...&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-4 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;free form:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/category/mysql&quot;&gt;mysql&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/category/osx&quot;&gt;osx&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 11 Jan 2011 07:56:53 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">107 at https://build2be.com</guid>
</item>
<item>
 <title>Dumping all tables with drush</title>
 <link>https://build2be.com/content/dumping-all-tables-drush</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;I want a clean database without clicking.&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;echo &quot;\
SELECT concat(&#039;drop table &#039;, table_name, &#039;;&#039;) \
&amp;nbsp; FROM information_schema.tables \
&amp;nbsp; WHERE table_schema=schema()&quot; \
| `drush sql-connect` \
| grep &quot;^drop table &quot; \
| `drush sql-connect`&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This work only for single drupal / single schema installs.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 20 May 2010 10:46:21 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">103 at https://build2be.com</guid>
 <comments>https://build2be.com/content/dumping-all-tables-drush#comments</comments>
</item>
<item>
 <title>Create and Fill the database</title>
 <link>https://build2be.com/content/create-and-fill-database</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Just follow README.mysql.txt&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;mysqladmin -u root -p create drupaljam_demo
mysql -u root -p 
&amp;gt; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupaljam_demo.* TO &#039;drupaljam_demo&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;drupaljam_demo&#039;;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Prepare settings.php&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;mv default.settings.php settings.php 
chmod 777 settings.php&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Add the site to apache (my steps)&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;cd /etc/apache2/sites-available/
cp drupaljam.dev drupaljam.demo
vi drupaljam.demo 
a2ensite drupaljam.demo 
vi /etc/hosts
# add 127.0.0.3 drupal.demo
/etc/init.d/apache2 reload&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Run the install from &lt;a href=&quot;http://drupaljam.build2be.com&quot;&gt;http://drupaljam.build2be.com&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-4 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;free form:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/category/mysql&quot;&gt;mysql&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/category/mysqladmin&quot;&gt;mysqladmin&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 23 Jun 2009 09:23:58 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">83 at https://build2be.com</guid>
 <comments>https://build2be.com/content/create-and-fill-database#comments</comments>
</item>
<item>
 <title>Relocating the files directory</title>
 <link>https://build2be.com/content/relocating-files-directory</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Trying best practices I occasionally move the files directory from DRUPAL_ROOT/files/my-site.com to DRUPAL_ROOT/sites/my-sites/files&lt;/p&gt;
&lt;p&gt;Doing this has some implications for the files table content. All file-path are pointing to the wrong location.&lt;/p&gt;
&lt;p&gt;Quick solution for this is an mysql replace update query.&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;select replace(filepath, &#039;files/my-site/&#039;, &#039;sites/my-site/files/&#039;) from files;
# update files set filepath=replace(filepath, &#039;files/my-site/&#039;, &#039;sites/my-site/files/&#039;)&quot;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or through drush&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;drush sql query &quot;select replace(filepath, &#039;files/my-site/&#039;, &#039;sites/my-site/files/&#039;) from files&quot;
# drush sql query &quot;update files set filepath=replace(filepath, &#039;files/my-site/&#039;, &#039;sites/my-site/files/&#039;)&quot;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_re...&lt;/a&gt; for more examples&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-4 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;free form:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/category/drush&quot;&gt;drush&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/category/mysql&quot;&gt;mysql&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/category/planet-drupal&quot;&gt;planet drupal&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 03 Feb 2009 10:10:58 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">76 at https://build2be.com</guid>
 <comments>https://build2be.com/content/relocating-files-directory#comments</comments>
</item>
<item>
 <title>mysql cycle</title>
 <link>https://build2be.com/content/mysql-cycle</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;I still forget how to do the database and user creation and drop goes. So why not make a note.&lt;/p&gt;
&lt;p&gt;Creating&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;create database test;
create user &#039;test&#039; identified by &#039;pwtest&#039;;
grant all on test.* to &#039;test&#039;@&#039;localhost&#039; identified by &#039;pwtest&#039;;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Cleaning up&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;drop user test;
drop database;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Yeah ... call me stupid ;-)&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 03 Mar 2008 11:18:36 +0000</pubDate>
 <dc:creator>clemens</dc:creator>
 <guid isPermaLink="false">25 at https://build2be.com</guid>
 <comments>https://build2be.com/content/mysql-cycle#comments</comments>
</item>
</channel>
</rss>
