编程人 cdmana.com

Building Linux web server - MySQL

Using source code installation , Some parameters can be added according to the actual production environment , promote mysql performance

mysql Official website https://www.mysql.com/

In this paper 5.1 Version dedicated installation instructions , Later versions are as follows 5.5 The installation method will be a little different , It's also useful in some of the company's production environments

5.1 edition mysql.

download mysql Source code

decompression tar zxf mysql-5.1.72.tar.gz


cd  mysql-5.1.72


To configure

./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

[root@backupserver mysql-5.1.72]# ./configure --help   Check the specific configuration parameters


make&&make install

Here we use the development test template

/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 to grant authorization mysql Users can access mysql Catalog

/usr/local/mysql/bin/mysql_install_db --user=mysql install mysql Database files

There will be some instructions after installation , Such as how to start and so on .

Installation instructions method startup mysql

/usr/local/mysql/bin/mysqld_safe/usr/local/mysql/bin/mysqld_safe &    & Means running in the background

For a more convenient startup mysql, Can be mysql Add to global variables

take mysql Add to global variables echo 'export PATH=$PATH:/usr/local/mysql/bin'>>/etc/profile

source /etc/profile

perform mysql Access to database

[root@backupserver 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) 2000, 2013, Oracle and/or its affiliates. All rights reserved.


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

affiliates. Other names may be trademarks of their respective

owners.



To configure /etc/init.d/mysqld start-up mysql

cp support-files/mysql.server  /etc/init.d/mysqld

chmod 700 /etc/init.d/mysqld to grant authorization ,

take mysql The service starts when the machine is turned on  

[root@backupserver mysql-5.1.72]# chkconfig --add mysqld

[root@backupserver mysql-5.1.72]# chkconfig mysqld  on

mysql Access to database

Set the password set password for root@localhost=PASSWORD('123456');

Follow up with mysql -uroot -p Form entry mysql database


Scroll to Top