CentOS successfully installed mysql-5.5.37

Source: Internet
Author: User

Excerpt from http://www.2cto.com/os/201404/296364.html (original note)

These days under the CentOS install MySQL, here to record the installation process, convenient for later review

Mysql5.5.37 installation needs to start cmake,5.6 version cmake to compile, 5.5 later version should also install this.

Installing CMake

[Plain] View plaincopyprint?01. [Email protected] ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
02.[[email protected] ~]# tar xvf cmake-2.8.12.2.tar.gz
03.[[email protected] ~]# CD cmake-2.8.12.2
04.[[email protected] Cmake-2.8.12.2]#./bootstrap
05.[[email protected] cmake-2.8.12.2]# make
06.[[email protected] cmake-2.8.12.2]# make install
[Email protected] ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
[Email protected] ~]# tar xvf cmake-2.8.12.2.tar.gz
[Email protected] ~]# CD cmake-2.8.12.2
[Email protected] Cmake-2.8.12.2]#./bootstrap
[[email protected] cmake-2.8.12.2]# make

[[email protected] cmake-2.8.12.2]# make install MySQL

[Plain] View plaincopyprint?01. [Email protected] ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
02.[[email protected] ~]# tar xvf mysql-5.5.37.tar.gz
03.[[email protected] ~]# CD mysql-5.5.37
04.[[email protected] mysql-5.5.37]# cmake.
[Email protected] ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
[Email protected] ~]# tar xvf mysql-5.5.37.tar.gz
[Email protected] ~]# CD mysql-5.5.37
[Email protected] mysql-5.5.37]# CMake.

It's probably going to be a mistake, not a jump.

[Plain] View Plaincopyprint?01.cmake Error at cmake/readline.cmake:83 (MESSAGE):
02.Curses Library not found. Pleaseinstall appropriate package,
03.remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name Islibncurses5-dev, on Redhat and derivates it is ncurses-devel.
04.Call Stack (most recent call first):
cmake/readline.cmake:127 (find_curses)
cmake/readline.cmake:217 (Mysql_use_bundled_libedit)
. cmakelists.txt:355 (Mysql_check_readline
08.--configuring incomplete, Errors occurred!
09.See also "/root/my/mysql-5.5.37/cmakefiles/cmakeoutput.log".
10.See also "/root/my/mysql-5.5.37/cmakefiles/cmakeerror.log".
CMake Error at cmake/readline.cmake:83 (MESSAGE):
Curses Library not found. Pleaseinstall appropriate package,
Remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name Islibncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:127 (find_curses)
cmake/readline.cmake:217 (Mysql_use_bundled_libedit)
cmakelists.txt:355 (mysql_check_readline
--Configuring incomplete, Errors occurred!
See also "/root/my/mysql-5.5.37/cmakefiles/cmakeoutput.log".
See also "/root/my/mysql-5.5.37/cmakefiles/cmakeerror.log".

Stating that the CentOS system is not ncurses-devel

[Plain] View plaincopyprint?01. [Email protected] ~]# wgethttp://invisible-island.net/datafiles/release/ncurses.tar.gz
02.[[email protected] ~]# CD ncurses-5.9
03.[[email protected] Ncurses-5.9]#./configure
04.[[email protected] ncurses-5.9]# make
05.[[email protected] ncurses-5.9]# make install
[Email protected] ~]# wgethttp://invisible-island.net/datafiles/release/ncurses.tar.gz
[Email protected] ~]# CD ncurses-5.9
[Email protected] Ncurses-5.9]#./configure
[[email protected] ncurses-5.9]# make
[[email protected] ncurses-5.9]# make install

Then delete the CMakeCache.txt file that you just compiled, or you cannot proceed to the next step

[Plain] View plaincopyprint?01. [Email protected] mysql-5.5.37]# rm-f CMakeCache.txt
[Email protected] mysql-5.5.37]# rm-f CMakeCache.txt

Continue compiling MySQL

[Plain] View plaincopyprint?01. [Email protected] ~]# CMake.
02.[[email protected] ~]# make
03.[[email protected] ~]# make install
[Email protected] ~]# CMake.
[[email protected] ~]# make
[[email protected] ~]# make install

This way, MySQL will install successfully to/usr/local/mysql by default

Create a MySQL user group

[Plain] View plaincopyprint?01. [[email protected] ~]# Groupadd MySQL
02.[[email protected] ~]# useradd–r–g MySQL MySQL
03.[[email protected] ~]# chown–r mysql.mysql/usr/local/mysql
[[email protected] ~]# Groupadd MySQL
[[email protected] ~]# useradd–r–g MySQL MySQL
[Email protected] ~]# chown–r mysql.mysql/usr/local/mysql

Start MySQL

[Plain] View plaincopyprint?01. [Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
[Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql

There may be an error, no skipping:

[Plain] View plaincopyprint?01.fatal error:could not find./bin/my_print_defaults
02.If compiled from source, you need Torun ' make install ' to
03.copy the software into the correct locationready for operation.
04.If you is using a binary release, you Musteither is at the top
05.level of the extracted archive, or pass the--BASEDIR option
06.pointing to the location.
FATAL Error:could not Find./bin/my_print_defaults
If you compiled from source, you need Torun "make install" to
Copy the software into the correct locationready for operation.
If you is using a binary release, you Musteither is at the top
Level of the extracted archive, or pass the--BASEDIR option
Pointing to the location.

Workaround:

[Plain] View plaincopyprint?01. [Email protected] ~]#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/ Usr/local/mysql/data
[Email protected] ~]#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/ Usr/local/mysql/data

Start MySQL again

[Plain] View plaincopyprint?01. [Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
[Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql

Register MySQL service, boot automatically

1. Set up MySQL configuration file to/etc directory

[Plain] View plaincopyprint?01. [Email protected] ~]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
[Email protected] ~]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF

2. Set up MySQL Boot

[Plain] View plaincopyprint?01. [Email protected] ~]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql
02.[[email protected] ~]# chmod +x/etc/init.d/mysql
03.[[email protected] ~]#/sbin/chkconfig--add MySQL
[Email protected] ~]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql
[Email protected] ~]# chmod +x/etc/init.d/mysql
[[email protected] ~]#/sbin/chkconfig--add MySQL

3. Start the MySQL service

You can add System variables: Export path=/usr/local/mysql/bin/: $PATH
[Plain] View plaincopyprint?01. [[Email protected] ~]# service MySQL start
[[Email protected] ~]# service MySQL start

If there is an error starting MySQL: error! The server quit without updating PID file (/usr/local/mysql/data/iz23i33p2ccz.pid).

You can view the log Cat/usr/local/mysql/data/iz23i33p2ccz.err

Execute /usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/ Mysql/data Auto Refresh under reboot

Test if MySQL is installed successfully

[Plain] View plaincopyprint?01. [Email protected] ~]#/usr/local/mysql/bin/mysql-u root-p
02.Enter Password:
03.Welcome to the MySQL Monitor. Commands End With; or \g.
04.Your MySQL Connection ID is 1
05.Server version:5.5.37 Source Distribution
06.
07.Copyright (c), Oracle and/or itsaffiliates. All rights reserved.
08.
09.Oracle is a registered trademark of oraclecorporation and/or its
10.affiliates. Other names trademarksof their respective
11.owners.
12.
13.Type ' help, ' or ' \h ' for help. Type ' \c ' toclear the current input statement.
14.
15.mysql> show databases;
16.+--------------------+
17.| Database |
18.+--------------------+
19.| Information_schema |
20.| MySQL |
21.| Performance_schema |
22.| Test |
23.+--------------------+
24.4 rows in Set (0.03 sec)

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.