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