Mysql compilation and installation _ MySQL

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.