Conquer MySQL DBA for Linux system O & M (1)-source code installation _ MySQL

Source: Internet
Author: User
Conquer MySQL DBA for Linux system O & M (I)-source code installation Conquer MySQL DBA for Linux system O & M (I) source code installation

Chapter 2 MySQL overview
1.1 MySQL introduction
MySQL is the most popular open-source SQL database management system. it is developed, released, and supported by MySQL AB.
. Its plug-in storage engine allows users to use different storage based on their actual applications.
1.2 MySQL-related links
MySQL official website: http://www.mysql.com/
MySQL community version: http://www.mysql.com/downloads/mysql/
MySQL documents: http://dev.mysql.com/doc/refman/5.1/zh/index.html
MySQL practical documentation: http://www.unixhot.com/pdf/mysql.pdf


Chapter 4 install MySQL source code

There are many ways to install MySQL, and the source code installation is more customizable. you can specify the location of the file to be installed, you need
Functions to be compiled.
2.1 decompress and compile and install
[Root @ MySQL-Master ~] # Cd/usr/local/src
[Root @ MySQL-Master src] # wget
Http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.1/mysql-5.1.56.tar.gz
[Root @ MySQL-Master src] # tar zxvf mysql-5.1.56.tar.gz
[Root @ MySQL-Master src] # cd mysql-5.1.56
[Root @ MySQL-Master mysql-5.1.56] #./configure -- prefix =/usr/local/mysql/
-- Localstatedir =/data/mysql -- enable-validator/
-- With-client-ldflags =-all-static -- with-mysqld-ldflags =-all-static/
-- With-pthread -- enable-static -- with-big-tables -- without-ndb-debug/
-- With-charset = utf8 -- with-extra-charsets = all/
-- Without-debug -- enable-thread-safe-client -- enable-local-infile -- with-plugins = max
[Root @ MySQL-Master mysql-5.1.56] # make & make install


2.2 installation parameters
-- Prefix =/usr/local/mysql // Main program installation directory
-- Localstatedir =/data/mysql // data file storage directory
-- With-client-ldflags =-all-static -- with-mysqld-ldflags =-all-static // install the mysql client and server through static compilation
-- With-pthread // use a thread
-- With-big-tables // Large table support
-- With-charset = utf8 // the default character set is utf8
-- With-extra-charsets = all // install all character sets
-- Without-debug // remove the debug mode
-- Enable-thread-safe-client // compile the client in thread mode
-- With-plugins = max // add support for innodb and partition
-- Enable-local-infile // load data support


2.3 create Users and Groups
[Root @ MySQL-Master mysql-5.1.56] # groupadd mysql
[Root @ MySQL-Master mysql-5.1.56] # useradd-s/sbin/nologin-M-g mysql
2.4 install a database
[Root @ MySQL-Master mysql-5.1.56] # cd/usr/local/mysql/
[Root @ MySQL-Master mysql] # mkdir-p/data/mysql
[Root @ MySQL-Master mysql] # bin/mysql_install_db -- basedir =/usr/local/mysql/-- datadir =/data/mysql/
-- User = mysql
2.5 modify the corresponding permissions
[Root @ MySQL-Master mysql] # chown-R root: mysql/usr/local/mysql/
[Root @ MySQL-Master mysql] # chown-R mysql: mysql/data/mysql/
2.6 configuration file
[Root @ MySQL-Master mysql] # cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my. cnf
[Root @ MySQL-Master mysql] # cp/usr/local/mysql/share/mysql. server/etc/init. d/mysqld
[Root @ MySQL-Master mysql] # chmod 755/etc/init. d/mysqld
[Root @ MySQL-Master mysql] # chkconfig -- add mysqld
[Root @ MySQL-Master mysql] # vim/root/. bash_profile
PATH = $ PATH: $ HOME/bin:/usr/local/mysql/bin
[Root @ MySQL-Master mysql] # source/root/. bash_profile
2.7 start the database and initialize the password.
[Root @ MySQL-Master mysql] # service mysqld start

Starting MySQL [OK]
[Root @ MySQL-Master mysql] # mysqladmin-u root password 123456 // Set the password to your own password

This article is from the "xmshuiyong 'blog" blog, please be sure to keep this source http://xmshuiyong.blog.51cto.com/1980172/1036134

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.