Linux Web server Build-mysql article

Source: Internet
Author: User

Using the source code installation, can add some parameters according to the actual production environment, improve MySQL performance

MySQL official website https://www.mysql.com/

This article uses the 5.1 version of the dedicated installation instructions, the following version of the 5.5 installation method will be somewhat different, in some of the company's production environment is also useful to

Version 5.1 MySQL.

Download MySQL source code

Unzip the tar zxf mysql-5.1.72.tar.gz


CD? mysql-5.1.72


Configuration

./configure--prefix=/usr/local/mysql \

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

--localstatedir=/usr/local/mysql/data\??

--enable-assemble \

--enable-thread-safe-client \

--with-mysqld-user=mysql \

--with-big-tables \

--with-pthread \

--with-extra-charsets=complex \

--with-readline \

--WITH-SSL \

--with-mysqld-ldflags=-all-static \

--with-client-ldflags=-all-static

[[email protected] mysql-5.1.72]#./configure--help? View specific configuration parameters


Make&&make Install

The development test template is used here

/BIN/CP support-files/my-small.cnf? /etc/my.cnf

Create a database file

Mkdir-p/usr/local/mysql/data

Chown-r mysql/usr/local/mysql authorized MySQL user can access MySQL directory

/usr/local/mysql/bin/mysql_install_db--user=mysql installing MySQL database files

After installation there will be some instructions, such as how to start and so on.

Install installation instructions method start MySQL

/usr/local/mysql/bin/mysqld_safe/usr/local/mysql/bin/mysqld_safe &?& To run in the background

MySQL can be added to global variables for easier start of MySQL

Add MySQL to the global variable echo ' export path= $PATH:/usr/local/mysql/bin ' >>/etc/profile

Source/etc/profile

Execute MySQL into the database

[[email protected] mysql-5.1.72]# MySQL

Welcome to the MySQL Monitor. ? Commands End With; or \g.

Your MySQL Connection ID is 1

Server version:5.1.72 Source Distribution


Copyright (c) and/or, Oracle, its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.



Configure/ETC/INIT.D/MYSQLD to start MySQL

CP Support-files/mysql.server?/etc/init.d/mysqld

chmod 700/etc/init.d/mysqld Authorized,

Add MySQL service to boot boot?

[Email protected] mysql-5.1.72]# chkconfig--add mysqld

[Email protected] mysql-5.1.72]# chkconfig mysqld? on

MySQL into the database

Sets the password set password for [email protected]=password (' 123456 ');

Subsequent use of the Mysql-uroot-p form into the MySQL database


Linux Web server Build-mysql article

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.