Skip to content

Instantly share code, notes, and snippets.

@g-alonso
Last active December 18, 2015 04:38
Show Gist options
  • Save g-alonso/5726445 to your computer and use it in GitHub Desktop.
Save g-alonso/5726445 to your computer and use it in GitHub Desktop.
Compile Mysql 5.6.12, Debian 7
#Compile mysql-5.6.12
groupadd mysql
useradd -g mysql mysql
./configure --prefix=/usr/local/mysql
#error ./configure: command not found
sudo apt-get install cmake
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock
#error Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
#CMake Error at cmake/readline.cmake:85 (MESSAGE):
#Curses library not found. Please install appropriate package,
#remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
sudo apt-get install libncurses5-dev
rm -f CMakeCache.txt
make
make install
sudo cp support-files/my-default.cnf /etc/my.cnf
sudo cp support-files/mysql.server /etc/init.d/mysql
sudo chmod 775 /etc/init.d/mysql
chown -R mysql:mysql .
./scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
#error
#FATAL ERROR: Could not find ./bin/my_print_defaults
#If you compiled from source, you need to run 'make install' to
#copy the software into the correct location ready for operation.
#If you are using a binary release, you must either be at the top
#level of the extracted archive, or pass the --basedir option
#pointing to that location.
#fix
# which my_print_defaults
/usr/local/mysql/bin/my_print_defaults
./scripts/mysql_install_db --basedir=/usr/local/mysql --user=mysql --datadir=/var/lib/mysql
/etc/init.d/mysql restart
#error
#[FAIL] MySQL server PID file could not be found! ... failed!
#Starting MySQL
#[FAIL..] The server quit without updating PID file (/usr/local/mysql/data/pomelo.pid). ... failed!
sudo tail -f /usr/local/mysql/data/pomelo.err
#2013-06-06 01:40:52 20561 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
#Fix
#Check valid params on my.cnf
basedir = /usr/local/mysql
datadir = /var/lib/mysql
port = 3306
server_id = 1
socket = /tmp/mysql.sock
./bin/mysqladmin -u root password '123' #change password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment