Skip to content

Instantly share code, notes, and snippets.

@blackandred
Created July 18, 2018 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackandred/20251fc19db3045a79a265b828bee404 to your computer and use it in GitHub Desktop.
Save blackandred/20251fc19db3045a79a265b828bee404 to your computer and use it in GitHub Desktop.
Docker + MySQL 5.1 problem solution: "[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host'" "docker"
#!/bin/bash
if [[ ! -f /var/lib/mysql/ibdata1 ]]; then
cd /usr/local/mysql/
mysql_install_db --user=mysql --ldata=/var/lib/mysql
fi
echo " >> Starting MySQL from /var/lib/mysql"
exec mysqld --datadir=/var/lib/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment