Mysql 5.6.24 and mysql 5.6.24
Preparations before installation:
1) edit the PATH
Vim/etc/profile
PATH =/home/mysql/bin:/home/mysql/lib: $ PATH
Export PATH
2) Effective PATH
Source/etc/profile
3) EDIT hosts
Vim/etc/hosts
192.168.117.130 cc-test
Install
1. Environment Configuration
Yum install-y gcc-c ++ make cmake
2. install the package mysql-5.6.24.tar.gz and copy it to the/home directory.
Rz
3. Unzip the installation package and rename it
Tar-zxvf mysql-5.6.2.tar.gz
Music mysql-5.6.2.tar.gz mysql
4. New user groups and users
Groupadd mysql
Useradd mysql-g mysql
5. Create data
Mkdir/home/mysql/data
6. Compile mysql
Cmake \
-DCMAKE_INSTALL_PREFIX =/home/mysql \
-DMYSQL_UNIX_ADDR =/home/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_ARCHIVE_STORAGE_ENGINE = 1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE = 1 \
-DWITH_MEMORY_STORAGE_ENGINE = 1 \
-DWITH_READLINE = 1 \
-DENABLED_LOCAL_INFILE = 1 \
-DMYSQL_DATADIR =/home/mysql/data \
-DMYSQL_USER = mysql \
-DMYSQL_TCP_PORT = 3306
7. Install
Make install
Make clean
8. Modify the directory owner
Chown-R mysql: mysql/home/mysql
Chown-R mysql: mysql/home/mysql/data
9. initialize the configuration script
Scripts/mysql-install-db -- user = nysql -- datadir =/home/mysql/data
10. Change permissions again
Chown-R mysql: mysql/home/mysql
11. Copy the server startup script
Cp/home/mysql/support-files/mysql. server/etc/init. d/mysql
Chmod 755/etc/init. d/mysql
Cp/home/mysql/support-files/my-default.cnf/etc/my. cnf
12. Start
Service mysqld start
13. Check whether the netstat-anp port is listening.
14. Enter mysql
Cd/mysql/bin
./Mysql-u root-p
Question 1:
[Root @ cc-test mysql] # cmake.
The following error message is displayed:
-- Cocould NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline. cmake: 82 (MESSAGE ):
Curses library not found. Please install appropriate package,
Remove CMakeCache.txt and rerun cmake. On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first ):
Cmake/readline. cmake: 126 (FIND_CURSES)
Cmake/readline. cmake: 216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt: 250 (MYSQL_CHECK_READLINE)
-- Refreshing incomplete, errors occurred!
Solution:
[Root @ cc-test mysql] # rm CMakeCache.txt
[Root @ cc-test mysql] # yum install ncurses-devel
Warning: Bison executable not found in PATH
-- Processing ing done
-- Generating done
-- Build files have been written to:/software/mysql-5.5.11
[Root @ cc-test mysql] # yum install bison
[Root @ cc-test mysql] # cmake ......
[Root @ cc-test mysql] # make install
Question 2:
[Root @ cc-test mysql] # scripts/mysql_install_db -- user = mysql -- datadir =/home/mysql/data
-Bash: scripts/mysql_install_db: Permission denied
Solution:
[Root @ cc-test mysql] # chmod 755 scripts/mysql_install_db
Question 3:
PID error during service mysqld start startup
Solution:
Chown-R mysql. mysql
Su-mysql
-Bash-4.1 $ (ctrl + d)
Scripts/mysql. install_db/home/mysql/bin/mysql_safe -- user = mysql &/etc/rc. d/init. d/mysqld status
/Etc/rc. d/init. d/mysqld start