MySQL installation under Linux (detailed rpm, source code and binary version installation) detailed

Source: Internet
Author: User
Tags odbc mysql in

MySQL installation under Linux
One, the version of MySQL
1. Two-in-plate
2. The source version name contains HRC as the logo

===============================================
The first part: Yum installation
1. Configure Yum Source

The code is as follows Copy Code

[Repo]
Name=repo
Baseurl=ftp://update:update@10.1.1.1/server
Enabled=1
Gpgcheck=0

2. RPM installation needs to install the software

The code is as follows Copy Code

mysql.i686 <-Client
mysql-devel.i686 <-Development Kit
mysql-libs.i686 <-Library
mysql-server.i686 <-Server
mysql-bench.i686 <-pressure test
mysql-connector-java.i686 <-Connection Java
mysql-connector-odbc.i686 <-even ODBC
mysql-test.i686

You can use the command: Yum install mysql*-y <-if the Yum source is configured correctly
===============================================
Part II:
before installing the source and binary packages, let's say some of the habits that MySQL uses

No process and file UID-> MySQL

Software source

The code is as follows Copy Code
RPM Installed in/var/lib/mysql
SOURCE | | Binary installed in/usr/local/mysql

Database

The code is as follows Copy Code
RPM Defaults to/var/lib/mysql/data
SOURCE | Binary--> Personal, corporate habits (/database)

Socket Interface <-Local (client) Link (server) interface
RPM Defaults to/tmp/mysql.sock

The code is as follows Copy Code

SOURCE | Binary--> Personal, corporate habits (/var/run/mysqld/mysql5.socket)

PORT 3306

Log
Recommended for storage in/var/log/mysqld/*

Configuration file

The code is as follows Copy Code
RPM-> (Client | | server)->/ETC/MY.CNF
SOURCE | Binary-> client->/etc/my.cnf
SOURCE | Binary->server->/usr/local/mysql/etc/my.cnf
===============================================
##### prerequisite-> must have MySQL user (uid, gid 27) #####
#groupadd-G MySQL
#useradd-G mysql-u MySQL
##############################################

Part III: Installing MySQL in binary version

1. Package for: mysql-5.1.36-linux-i686-glibc23.tar.gz, can go to MySQL website download

A. Decompression-> (can be extracted directly, can be soft chain)->/usr/local/mysql

The code is as follows Copy Code
Ln-s/usr/local/mysql-5.1.36-linux-i686-glibc23-n/usr/local/mysql
Chown Mysql:mysql/usr/local/mysql-r
chmod 1777/tmp

B. Server Configuration
-> Editor/usr/local/mysql/etc/my.cnf

  code is as follows copy code

[Mysqld]
User=mysql
Basedir=/usr/local/mysql
datadir=/database
Socket=/var/run/mysqld/mysql5.socket
Pid-file=/var/run/mysqld/mysql5.pid
General-log
General-log-file=/var/log/mysqld/mysql5-access.log
Log-error=/var/log/mysqld/mysql5-error.log
port=3306

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.