Several ways to install MySQL:
1, the operating system comes with the RPM package, 2, the official MySQL RPM package, 3, the general binary format; 4, source code compilation
The following is installed by the method of yard code compilation, is Http://pan.baidu.com/s/1pJOhujh
Decompression: TAR-ZXF mysql-5.5.36.tar.gz
Switch to extract directory: CD mysql-5.5.36
Install the build environment: Yum install readline-devel ssl-devel zlib-devel gcc gcc-c++ ncurses-devel cmake-y
Compile: CMake. -dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/mydata/data \
-dsysconfdir=/etc-dwith_innobase_storage_engine=1
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_readline=1 \
-dwith_ssl=system \
-dwith_zlib=system \
-dwith_libwrap=0 \
-dmysql_unix_addr=/tmp/mysql.sock \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
Finally, male and make install.
Of course, the installation environment of the appeal is not a successful one at a time, I am in my own machine environment, but also after many tests to succeed. If you are on your machine, you may also have to fail several times. If you fail, you need to delete CMakeCache.txt before compiling. Here is the error I quoted:
CMake error:your CXX Compiler: "Cmake_cxx_compiler-notfound" was not found. Need to install gcc-c++
Curses Library not found. Please install the appropriate package. Need to install Ncurses-devel
After the installation is MySQL's initial chemical industry.
1. Modify users and Groups:
Add MySQL group: groupadd-r mysql; add MySQL User: Useradd-r-G mysql-s/sbin/nologin
Create/mydata/data directory: Mkdir-p/mydata/data
Modified: chown-r: Mysql/usr/local/mysql; Chown-r Mysql:mysql/mydata/data
2. Execute initialization script: scripts/mysql_install_db--user=mysql--datadir=/mydata/data
Install MySQL under Linux