Skip to content

Instantly share code, notes, and snippets.

@veapon
Created March 4, 2015 15:18
Show Gist options
  • Save veapon/5bb7404257c3eaf4f6a0 to your computer and use it in GitHub Desktop.
Save veapon/5bb7404257c3eaf4f6a0 to your computer and use it in GitHub Desktop.
mysql compile shell for centos 7
yum -y install cmake gcc-c++ ncurses-devel perl-Data-Dumper
groupadd mysql
useradd -g mysql -M -s /sbin/nologin mysql
mkdir -p /data/mysql
mkdir -p /servers/mysql
/usr/bin/cmake . -DCMAKE_INSTALL_PREFIX=/servers/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make
make install
cp /servers/mysql/support-files/my-default.cnf /etc/my.cnf
/servers/mysql/scripts/mysql_install_db --user=mysql --basedir=/servers/mysql --datadir=/data/mysql --no-defaults
/servers/mysql/support-files/mysql.server start
/servers/mysql/bin/mysqladmin -u root password 'root'
chown -R mysql.mysql /data/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment