Three major installation methods for MySQL 5.5: [binary, source code compilation, and RPM package] installation steps and comparison of advantages and disadvantages

Source: Internet
Author: User

Three major installation methods for MySQL 5.5: [binary, source code compilation, and RPM package] installation steps and advantages and disadvantages (I) source code compilation ① install cmake [plain] # wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz # Tar-zxv-f cmake-2.8.5.tar.gz-C/usr/local/src # cd/usr/local/src/cmake-2.8.5 #. /bootstrap # make install ② new MySQL user [plain] # groupadd dba # useradd-g dba mysql # cp mysql-5.5.16.tar.gz/home/mysql/# chown-R mysql: dba/home/mysql/mysql-5.5.16.tar.gz ③ CMake compile MySQL 5.5 [plain] # su-mysql $ tar-zxv-f mysql-5.5.16.tar.gz $ cd mysql-5.5.16 $ CFLAGS = "-O3" CXX = gcc $ CXXFLAGS = "-O3 -Felide-constructors-fno-exceptions-fno-rtti "$ cmake. -LH | more // view MySQL compilation configuration under CMake $ cmake. -DCMAKE_INSTALL_PREFIX =/home/mysql-DEXTRA_CHARSETS = all $ make-j 8 // 8-core parallel compilation $ make install ④ create a configuration file [plain] $ cd/home/mysql /mysql $ su-root # cp/home/mysql/mysql-5.5.16/support-files/my-medium.cnf/etc/my. cnf/* this step can be omitted. By default, a */# chown-R mysql: dba/etc/my. cnf ⑤ modify the path of the configuration file, configuration data file, and log file [plai N] # su-mysql $ cd mysql $ mkdir run log tmp $ vim/etc/my. cnf ** added the following content: basedir =/home/mysql datadir =/home/mysql/data socket =/home/mysql/run/mysql. the socket configurations of sock/* Server and client must be the same */log-error =/home/mysql/log/alert. log log_slow_queries =/home/mysql/log/slow. log 6 initializes the MySQL configuration table [plain] $. /scripts/mysql_install_db -- basedir =/home/mysql -- datadir =/home /Mysql/data -- user = mysql -- force 7 start mysql [plain]. /bin/mysqld_safe & benefits: the platform-independent and installed MySQL directory is independent (convenient and clear). It is said that it has better performance and platform coupling disadvantages: slow compilation and installation (ii) The format of the binary distribution version on the official website is as follows: mysql-<version>-<OS> -tar.gz ① create users and groups [plain] # groupadd dba # useradd-g dba mysql ② decompress the package to the specified directory [plain] # tar-zxv- f mysql-5.5.30-linux2.6-i686.tar.gz-C/usr/local/# mv/usr/local/mysql-5.5.30-linux2.6-i686/usr/local/mysql # cd/usr/local/mysql ③ Change permission [plain] # chown-R mysql. # chgrp-R dba. ④ initialize MySQL configuration table [plain] # scripts/mysql_install_db -- user = mysql ⑤ change data directory permission [plain] # chown-R root. # chown-R mysql data 6 copy the configuration file [plain] # cp support-files/my-medium.cnf/etc/my. cnf 7 create soft link [plain] # ln-s/usr/local/mysql/bin/mysqld_safe/usr/local/bin # ln-s/usr/local/mysql/bin /mysqladmin/usr/local/bin # ln-s/usr/local/mysql/bin/mysql/usr /Local/bin restart start MySQL service [plain] # bin/mysqld_safe -- user = mysql & benefits: mySQL uses glibc for development, and the glibc library is an underlying API. Therefore, as long as it is Linux, there will be a glibc library, and portability is very convenient for the base distribution version and source distribution version, the former has been compiled and optimized, and the latter has not (3) the RPM package installation method is extremely simple. Here we will not go into details about other objects, such as: what do MySQL RPM packages mean? MySQL-VERSION.i386.rpm MySQL server. Unless you just want to connect to a MySQL server running on another machine, you will need it to MySQL-client-VERSION.i386.rpm the standard MySQL client program. You may always need to install this package for MySQL-bench-VERSION.i386.rpm testing and benchmarking. The libraries and inclusion files required for the Perl and msql-mysql-modules RPM MySQL-devel-VERSION.i386.rpm are required. If you want to compile other MySQL client programs, for example, the Perl module MySQL-VERSION.src.rpm contains the source code for all of the above packages. It can also be used to try to construct RPM (for example, Alpha or iSCSI) MySQL-Max-VERSION.rpm for other hardware platforms including client and server-side program MySQL-embedded-VERSION.i386.rpm and database systems designed for Embedded linux in most cases, you only need to install MySQL-server and MySQL-client. install other packages as needed. For example, where is the related directory after MySQL RPM is installed? /Usr/bin: client programs and scripts, for example, mysqladmin mysqldump and other commands/usr/sbin: mysqld/var/lib/mysql: Database directory/usr/share/mysql: mysql. server command and configuration file/etc/rc. d/init. d/

Related Article

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.