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 |