Common Linux tools: (2) Mysql rpm installation and compilation installation _ MySQL

Source: Internet
Author: User
Common Linux tools: (2) Mysql rpm installation and compilation

1. download.

Download http://dev.mysql.com/downloads/mirror.php here? Id = 402502.


2. install.

Download to local Unzip:

Tar-xvf MySQL-5.5.12-1.rhel5.x86_64.tar

Install the following rpm

Rpm-ivh MySQL-devel-5.5.12-1.rhel5.x86_64.rpm

Rpm-ivh MySQL-shared-5.5.12-1.rhel5.x86_64.rpm

Rpm-ivh MySQL-client-5.5.12-1.rhel5.x86_64.rpm

Rpm-ivh MySQL-server-5.5.12-1.rhel5.x86_64.rpm

3. configure users and user groups.

Groupadd mysql

Useradd mysql-g mysql

4. configure mysql.

Cd/usr/share/mysql/

Cp my-medium.cnf/etc/my. cnf # Here I am only used to demonstrate the application.

5. run mysql

Mysqld_safe &

6. configure the mysql root user

Mysqladmin-uroot password 'password'

7. set remote users

Create user 'geewu' @ '%' identified by 'password ';

Grant all on *. * TO 'gewu' @ '% ';

Mysql command line compilation

Groupadd mysql

Useradd-s/bin/false-g mysql-pmysql mysql

# Install mysql to home/work/local/mysql

./Configure -- prefix =/home/work/local/mysql/

-- With-unix-socket-path =/home/work/local/mysql/tmp/mysql. sock/

-- With-big-tables -- with-plugins = all -- with-client-ldflags = all-static -- with-mysqld-ldflags = all-static

Make; make install

1.-static 13%

-- With-client-ldflags =-all-static

-- With-mysqld-ldflags =-all-static

Static links increase performance by 13%

2.-pgcc 1%

CFLAGS = "-O3-mpentiumpro-mstack-align-double" CXX = gcc/

CXXFLAGS = "-O3-mpentiumpro-mstack-align-double/

-Felide-constructors-fno-exceptions-fno-rtti"

For Inter processors, use pgcc to improve performance by 1%

3. the Unix Socket 7.5%

-- With-unix-socket-path =/usr/local/mysql/tmp/mysql. sock

Using unix socket links improves performance by 7.5%, so mysql Performance in windows is certainly inferior to that in unix

4. -- enable-cycler

Allow Assembly mode (optimized performance)

Cd/home/work/local/mysql

Bin/mysql_install_db -- user = mysql // install the default database

Cp share/mysql/my-medium.cnf/etc/my. cnf // Copy the configuration file (which may need to be modified as appropriate)

Cp share/mysql. server/etc/init. d/mysqld // Copy the mysql startup script

Chmod 755/etc/init. d/mysqld // modify the mysql startup script permission. the execution permission is required.

Chkconfig -- add mysqld // add mysql service

Chkconfig -- level 35 mysqld on // set the service to start at runtime level 3 and 5

Service mysqld start // start the service

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.