Mysql compilation and installation _ MySQL
Last Update:2018-04-15
Source: Internet
Author: User
Mysql compilation and installation bitsCN.com
Mysql compilation installation # tar xvfz mysql-5.1.41.tar.gz # cd mysql-5.1.41 # echo "CHOST =/" x86_64-pc-linux-gnu/"CFLAGS =/"-march = native-O3-pipe-fomit-frame-pointer/ "CXX = gcc CXXFLAGS =/"-march = native-O3-pipe-fomit-frame-pointer-felide-constructors-fno-exceptions-fno-rtti /". /configure -- prefix =/usr/local/mysql -- with-unix-socket-path =/usr/local/mysql/tmp/mysql. sock -- enable-character er -- with-libwrap =/usr/lib/-- with-charset = gbk -- with-extra-charsets = gb2312, gbk, big5, latin1, utf8 -- with-mysqld-user = mysql -- with-big-tables -- with-client-ldflags =-all-static -- with-plugins = myisam, myisammrg, innobase, innodb_plugin, heap, csv, partition -- with-mysqld-ldflags =-all-static "> configure. sh // compile and install # chmod + x configure. sh #. /configure. sh # make & make install # groupadd mysql/add a mysql group # useradd-g mysql add a mysql user to the mysql group # cp support-files/my-medium.cnf/etc/my. cnf # cp support-files/mysql. server/etc/rc. d/init. d/mysqld # chmod 700/etc/init. d/mysqld # chkconfig -- add mysqld # chkconfig -- level 345 mysqld on # cd/usr/local/mysql # bin/mysql_install_db -- user = mysql # chown-R root. # chown-R mysql var # chgrp-R mysql. # bin/mysqld_safe -- user = mysql & # bin/mysqladmin-uroot-poldpwd password XXXX mysql multi-instance installation ================== ========================= multi-instance installation ========================== ================================#tar xvfz mysql-5.1.59.tar.gz # cd mysql-5.1.59 (Linux 5.3) echo "CFLAGS =/"-O3-mpentiumpro/"CXX = gcc CXXFLAGS =/"-O3-mpentiumpro-felide-constructors-fno-exceptions-fno-rtti /". /configure -- prefix =/usr/local/mysql -- with-unix-socket-path =/usr/local/mysql/tmp/mysql. sock -- enable-character er -- with-libwrap =/usr/lib/-- with-charset = gbk -- with-extra-charsets = gb2312, gbk, big5, latin1, utf8 -- with-mysqld-user = mysql -- with-big-tables -- with-client-ldflags =-all-static -- with-plugins = myisam, myisammrg, innobase, innodb_plugin, heap, csv, partition -- with-mysqld-ldflags =-all-static "> configure1.sh GCC4.4 (Linux 6.2) echo "CHOST =/" x86_64-pc-linux-gnu/"CFLAGS =/"-march = native-O3-pipe-fomit-frame-pointer/"CXX = gcc CXXFLAGS =/"-march = native -O3-pipe-fomit-frame-pointer-felide-constructors-fno-exceptions-fno-rtti /". /configure -- prefix =/usr/local/mysql -- with-unix-socket-path =/usr/local/mysql/tmp/mysql. sock -- enable-character er -- with-libwrap =/usr/lib/-- with-charset = gbk -- with-extra-charsets = gb2312, gbk, big5, latin1, utf8 -- with-mysqld-user = mysql -- with-big-tables -- with-client-ldflags =-all-static -- with-plugins = myisam, myisammrg, innobase, innodb_plugin, heap, csv, partition -- with-mysqld-ldflags =-all-static "> configure. sh if the compilation problem occurs, you need to install the ncurses-devel-5.5-24.20060715.x86_64.rpm # chmod + x configure. sh #. /configure. sh # make & make install create mysql User # groupadd mysql # useradd-g mysql # cp support-files/my-medium.cnf/etc/my. cnf # cp support-files/mysql. server/etc/rc. d/init. d/mysqld # cp support-files/mysqld_multi.server/etc/rc. d/init. d/mysqld_multi # chmod 700/etc/init. d/mysqld (skip this step) # chkconfig -- add mysqld (skip this step) # chkconfig -- level 2345 mysqld off # cd/usr/local/mysql show variables like 'server _ id'; view server-idmysql> show variables like 'server _ id '; manually modify server-idmysql> set global server_id = 2; # The value here and my. mysql> slave start; 6) after changing the master, check the slave status. Note that slave_IO_running is NO, after completing the preceding operations, restart the mysql process (Initialize the data directory) # bin/mysql_install_db -- user = mysql -- datadir =/usr/local/mysql/var21001/# bin/mysql_install_db -- user = mysql -- datadir =/usr/local/mysql/var21002/ # bin/mysql_install_db -- user = mysql -- datadir =/usr/local/mysql/var21003/# bin/mysql_install_db -- user = mysql -- datadir =/usr/local/mysql/var (default value) # chown-R root. # chown-R mysql var21001/var21002/var21003/# chgrp-R mysql. # bin/mysqld_safe -- user = mysql & (installation completed here) # bin/mysqladmin-uroot-poldpwd password 1qaz @ WSX grant shutdown on *. * to admin @ localhost identified by 'pwd _ shutdown '; flush privileges; run the SQL command on the linux client: source/home/software/user_login. SQL grant all privileges on *. * to 'root' @ '%' identified by '000000'; flush privileges; grant shutdown on *. * TO 'admin' @ 'localhost' identified by 'pwd _ shutdown '; flush privileges; drop user'' @ 'localhost. localdomain '; drop user ''@ 'localhost'; drop user root@localhost.localdomain; grant shutdown on *. * TO 'admin' @ 'localhost' identified by 'pwd _ shutdown '; set password for root @ 'localhost' = password ('1qaz @ wsx '); set password for root @ '2017. 0.0.1 '= password ('1qaz @ wsx'); flush privileges; // set password for root @ 'localhost' = password ('XXX '); // set password for root @ '127. 0.0.1 '= password ('XXX'); grant replication slave on *. * TO 'repsyn' @ '%' identified '*********'; ====================================== multi-instance Installation === ============================================
BitsCN.com