Centos5.5 install Mysql5.5

Source: Internet
Author: User
Mysql has been installed in centos these days. Here we record the installation process. For more information, see Mysql5.5.37. cmake is required for installation. cmake is required for compilation at the beginning of mysql 5.6, this is also required for Versions later than 5.5. Install cmake [root @ local ~] Export wgetwww.cmake.orgfilesv2.8cmake-2.8.12.2.tar.gz [root @ l

Mysql has been installed in centos these days. Here we record the installation process. For more information, see Mysql5.5.37. cmake is required for installation. cmake is required for compilation at the beginning of mysql 5.6, this is also required for Versions later than 5.5. Install cmake [root @ local ~] # Wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz?root@l

Install mysql in centos these days. Record the installation process for future reference.

Cmake is required for Mysql5.5.37 installation, and cmake is required for MySQL 5.6 and later versions.

Install cmake

[root@local ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz[root@local ~]# tar xvf cmake-2.8.12.2.tar.gz[root@local ~]# cd cmake-2.8.12.2[root@local cmake-2.8.12.2]#./bootstrap[root@local cmake-2.8.12.2]# make[root@local cmake-2.8.12.2]# make install

Install mysql

[root@local ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz[root@local ~]# tar xvf mysql-5.5.37.tar.gz[root@local ~]# cd mysql-5.5.37[root@local mysql-5.5.37]# cmake ./

This error may be reported and skipped if no error is reported.

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".

The centos system does not have ncurses-devel.

[root@local ~]# wget http://invisible-island.net/datafiles/release/ncurses.tar.gz[root@local ~]# cd ncurses-5.9[root@local ncurses-5.9]#./configure[root@local ncurses-5.9]# make[root@local ncurses-5.9]# make install

Delete the CMakeCache.txt file generated in the previous compilation. Otherwise, you cannot proceed to the next step.

[root@local mysql-5.5.37]# rm -f CMakeCache.txt

Continue mysql Compilation

[root@local ~]# cmake ./[root@local ~]# make[root@local ~]# make install

By default, mysql is successfully installed in/usr/local/mysql.

Create a mysql user group

[root@local ~]# groupadd mysql[root@local ~]# useradd –r –g mysql mysql[root@local ~]# chown –R mysql.mysql /usr/local/mysql

Start mysql
[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql

An error may occur here. skip this step if no error occurs:

FATAL ERROR: Could not find./bin/my_print_defaultsIf you compiled from source, you need torun 'make install' tocopy the software into the correct locationready for operation.If you are using a binary release, you musteither be at the toplevel of the extracted archive, or pass the --basedir optionpointing to that location.

Solution:

[root@local ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

Start mysql again

[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql


Register the mysql service and start it automatically upon startup

1. Set the mysql configuration file to the/etc directory.

[root@local ~]# cp /usr/local/mysql/support-files/my-medium.cnf/etc/my.cnf

2. Set mysql to start automatically

[root@local ~]# cp/usr/local/mysql/support-files/mysql.server /etc/init.d/mysql[root@local ~]# chmod +x /etc/init.d/mysql[root@local ~]# /sbin/chkconfig --add mysql

3. Start the mysql Service

[root@local ~]# service mysql start

Test whether mysql is successfully installed.

[root@local ~]# /usr/local/mysql/bin/mysql -u root -pEnter password: Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.5.37 Source distribution Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved. Oracle is a registered trademark of OracleCorporation and/or itsaffiliates. Other names may be trademarksof their respectiveowners. Type 'help;' or '\h' for help. Type '\c' toclear the current input statement. mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || performance_schema || test               |+--------------------+4 rows in set (0.03 sec)

Refer:

Http://blog.csdn.net/mycwq/article/details/24488691

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.