<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MySQL on paapereira.xyz</title><link>https://paapereira.xyz/tags/mysql/</link><description>Recent content in MySQL on paapereira.xyz</description><generator>Hugo</generator><language>en-US</language><copyright>&lt;a href='https://creativecommons.org/licenses/by-nc/4.0/' target='_blank' rel='noopener'>©&lt;/a> 2008-2026 / &lt;a href='https://gitlab.com/paapereira/paapereira.gitlab.io' target='_blank' rel='noopener'>source code&lt;/a></copyright><lastBuildDate>Sun, 06 Nov 2011 18:27:00 +0000</lastBuildDate><atom:link href="https://paapereira.xyz/tags/mysql/index.xml" rel="self" type="application/rss+xml"/><item><title>Backing up MySQL in B3 Server to rsync.net</title><link>https://paapereira.xyz/posts/2011/11/backing-up-mysql-in-b3-server/</link><pubDate>Sun, 06 Nov 2011 18:27:00 +0000</pubDate><guid>https://paapereira.xyz/posts/2011/11/backing-up-mysql-in-b3-server/</guid><description>&lt;p>In a &lt;a href="https://paapereira.xyz/posts/offsite-backups-with-rsyncnet/">previous&lt;/a> post I talked about how to backup to &lt;a href="http://rsync.net/">rsync.net&lt;/a> using &lt;a href="http://duplicity.nongnu.org/">duplicity&lt;/a>.&lt;/p>
&lt;p>I will now show how to backup your &lt;a href="http://www.excito.com/">B3 Server&lt;/a> Mysql databases using the same method.&lt;/p>
&lt;h2 id="installation">Installation&lt;/h2>
&lt;p>Be sure duplicity is installed:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>su
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2&lt;/span>&lt;span>apt-get install duplicity
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="generate-an-ssh-key-to-connect-to-rsyncnet">Generate an ssh key to connect to rsync.net&lt;/h2>
&lt;ul>
&lt;li>Generate the ssh key using the defaults (don&amp;rsquo;t use a password when asked):&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>ssh-keygen -t rsa
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Copy your key to rsync.net (if you don&amp;rsquo;t have no one there):&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>scp ~/.ssh/id_rsa.pub user@server.rsync.net:.ssh/authorized_keys
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>If you already have a key from another machine or user in rsyn.net, you need to add a new one:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>cat ~/.ssh/id_rsa.pub | ssh user@server.rsync.net &lt;span style="color:#e6db74">&amp;#39;dd of=.ssh/authorized_keys oflag=append conv=notrunc&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="generate-a-gpg-public-and-private-key-to-encrypt-your-backups">Generate a gpg public and private key to encrypt your backups&lt;/h2>
&lt;ul>
&lt;li>Generate the gpg keys (get down your private key, example: &lt;em>123AbcH123BB4321&lt;/em>):&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>gpg --gen-key
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>You can check the keys in your system:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>gpg --list-keys
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Look in the output something like this. Look for the public key (in this example your public key is &lt;em>1AAB123A&lt;/em>)&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>pub 1239A/**1AAB123A** 2011-10-09 [expires: 2012-10-08]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2&lt;/span>&lt;span>uid Your Name (name) &amp;lt;mail@mail.com&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3&lt;/span>&lt;span>sub 54321/1234BBCC 2011-10-09 [expires: 2012-10-08]
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="backuprestore-your-databases">Backup/restore your databases&lt;/h2>
&lt;p>I have MyISAM tables, so I will be using the &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html">mysqlhotcopy&lt;/a> command. You can also use &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html">mysqldump&lt;/a>.&lt;/p></description></item><item><title>Apache, PHP and MySQL</title><link>https://paapereira.xyz/posts/2008/03/apache-php-and-mysql/</link><pubDate>Thu, 20 Mar 2008 21:31:00 +0000</pubDate><guid>https://paapereira.xyz/posts/2008/03/apache-php-and-mysql/</guid><description>&lt;p>Ok, setting up &lt;strong>Apache&lt;/strong>, &lt;strong>PHP&lt;/strong> and &lt;strong>MySQL&lt;/strong> is super easy. I used this &lt;a href="http://ubuntuforums.org/showthread.php?t=684347&amp;amp;highlight=mysql+database+folder">tip&lt;/a> from Ubuntu Forum.&lt;/p>
&lt;p>I also want to import my site and database from Windows.&lt;/p>
&lt;h2 id="install">Install&lt;/h2>
&lt;ul>
&lt;li>Go to System &amp;gt; Administration &amp;gt; Synaptic Package Manager&lt;/li>
&lt;li>Now go to Edit &amp;gt; Mark Packages by Task&lt;/li>
&lt;li>Choose LAMP Server (Linux/Apache/MySQL/PHP server)&lt;/li>
&lt;/ul>
&lt;p>In my case, the Ultimate Edition already had this installed :-)&lt;/p>
&lt;p>I just updated Apache, MySQL and PHP using System &amp;gt; Administration &amp;gt; Update Manager.&lt;/p></description></item></channel></rss>