title: Unattended Percona Server 5.7 install on Debian Jessie
body: <p>I'm trying to do an unattended install of Percona Server 5.7 from Percona's repository on Debian Jessie. I don't really care what root password I end up with, if any. That's secondary.</p>
  
  <p>So far I have been unsuccesful, ending up with three different scenarios, each failing in a different step:</p>
  
  <p>1) <code>DEBIAN_FRONTEND=noninteractive apt-get -y install percona-server-server-5.7</code> which hangs indefinitely: <a href="http://pastebin.com/QiYUsSJW" rel="nofollow">http://pastebin.com/QiYUsSJW</a></p>
  
  <p>The server is started and I can even connect to it using <code>mysql -S /var/run/mysqld/mysqld.sock</code> which is strange because of the "cannot connect to socket" warning in the paste above.</p>
  
  <p>There is no <code>/etc/mysql/my.cnf</code> file present at the time of the hang, however, the directory is there.</p>
  
  <p>2) use debconf-set-selections to pre-seed debconf database with these:</p>
  
  <blockquote>
    <p>percona-server-server-5.7 percona-server-server-5.7/root-pass password supersecret</p>
    
    <p>percona-server-server-5.7 percona-server-server-5.7/re-root-pass password supersecret</p>
  </blockquote>
  
  <p>and then proceed with <code>apt-get install percona-server-server-5.7</code></p>
  
  <p>In this step, apt fails because the password is still apparently blank: <a href="http://pastebin.com/hMsjn0wJ" rel="nofollow">http://pastebin.com/hMsjn0wJ</a> with these logs: <a href="http://pastebin.com/61KPgTth" rel="nofollow">http://pastebin.com/61KPgTth</a></p>
  
  <p>In this case the mysql service won't even start so I can't tell whether the password was actually set or not. However, checking debconf database at <code>/var/cache/debconf/passwords.dat</code> I can see the Password Value field is empty. Going back through the log to the line </p>
  
  <blockquote>
    <p>Apr 16 16:14:53 gtest mysql-systemd-start[2659]: /usr/share/mysql/mysql-systemd-start: line 37: [: too many arguments</p>
  </blockquote>
  
  <p>and analyzing the file I get to the point where <code>my_print_defaults</code> binary is executed and is supposed to return mysqld configuration values. Instead it prints nothing causing the start script fail with the above error. Why is it empty? Don't know. Likely because the /etc/mysql/my.cnf is nonexistent, much like as in previous case. This is also mentioned here:</p>
  
  <blockquote>
    <p>Apr 16 17:01:51 gtest mysql-systemd-start[12214]: Percona Server configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives.</p>
  </blockquote>
  
  <p>But I would expect this to be populated by apt at the installation time. Looks like some kind of a chicken-and-egg loop within apt but beyond my abilities.</p>
  
  <p>3) same as 2 except the password is deliberately set as empty. Results are the same as in <strong>step 1</strong>.</p>
  
  <p>I'm out of ideas. Any tips?</p>
  
  <p>thx.</p>