In the installation is the attention path!!!
First, download the compilation installation
#cd/usr/local/src/
#wget http://mysql.byungsoo.net/Downloads/MySQL-5.1/mysql-5.1.38.tar.gz
#tar –XZVF mysql-5.1.38.tar.gz. /software/
#./configure
--prefix=/usr/local/mysql//mysql installation directory
--datadir=/mydata//Database storage directory
--with-charset=utf8//using UTF8 format
--with-extra-charsets=complex//Install all extended character sets
--enable-thread-safe-client//Enable client Security thread
--with-big-tables//Enable large table
--WITH-SSL//Using SSL encryption
--with-embedded-server//compiled into embedded MySQL library (LIBMYSQLD.A),
--enable-local-infile//Allow import of data from local
--enable-assembler//Assembly x86 common operator, can improve performance
--with-plugins=innobase//Database Plugin
--with-plugins=partition//Sub-table function, dividing a large table into multiple small tables
#make && make installation//compile and install
1.3 Installing the related packages
1.3.1 CMake Software
cd/home/oldboy/tools/
Tar XF cmake-2.8.8.tar.gz
CD cmake-2.8.8
./configure
#CMake has bootstrapped. Now run Gmake.
Gmake
Gmake Install
Cd.. /
1.3.2 Dependency Packages
Yum Install Ncurses-devel-y
1.4 Starting MySQL Installation
1.4.1 Creating users and Groups
Groupadd MySQL
Useradd mysql-s/sbin/nologin-m-G MySQL
1.4.2 Decompression compiled MySQL
Tar zxf mysql-5.5.32.tar.gz
CD mysql-5.5.32
CMake. -dcmake_install_prefix=/application/mysql-5.5.32 \ Install root directory/linux socket directory
-dmysql_datadir=/application/mysql-5.5.32/data \ Database Storage Directory
-dmysql_unix_addr=/application/mysql-5.5.32/tmp/mysql.sock \ Sock File storage directory (can not add this parameter during installation)
The default socket file will point to/tmp/mysql.sock
-DDEFAULT_CHARSET=UTF8 \ Default Character Set
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \ Default Encoding
-DEXTRA_CHARSETS=GBK,GB2312,UTF8,ASCII \
-denabled_local_infile=on \ can use the Load Data INFILE command to import files locally---=-, dwith_innobase_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwithout_example_storage_engine=1 \
-dwithout_partition_storage_engine=1 \
-dwith_fast_mutexes=1 \
-dwith_zlib=bundled \
-denabled_local_infile=1 \
-dwith_readline=1 \
-dwith_embedded_server=1 \
-dwith_debug=0
Configuration parameters
-dcmake_install_prefix= Installation root directory
-dcmake_install_prefix= UNIX Socket Directory
-ddefault_charset= Default Character Set
-ddefault_collation= default encoding
-dwith_extra_charsets= additional encodings, use all to compile.
-dwith_myisam_storage_engine=1 compiles the MYISAM storage engine, the default storage engine, does not add can also
The-dwith_innobase_storage_engine=1 supports the InnoDB storage engine, which is also installed by default
-dwith_readline=1 using the READLINE function
-denabled_local_infile=1 can import files locally using the Load Data INFILE command
-dmysql_datadir= Database Data Directory
#cd/usr/local/mysql/bin
#mysql
>show databases;
#
MySQL installation ends
MySQL configuration method under Linux
The configuration file path for MySQL in Linux is under/usr/share/mysql
There are: My-huge.cnf, my-large.cnf, My-medium, my-small.cnf these files
Open one of these files as needed:
Found in file [mysqld]
Under this line, add datadir=filepath/* This path is the path for the database */
Then save the file
In the shell, enter
#cp my-***.cnf/etc
#cd/etc
#mv my.cnf My.cnf.bak/* Back up your system's previous MySQL configuration file */
#mv my-***.cnf my.cnf
#service mysqld Start/* starts MySQL service */
#ntsysv/* Configure MySQL self-boot, in the pop-up window, mysqld this service with a space selected, and finally confirm the save */
MySQL Source installation