How to install MySQL5.5 in CentOS5.5 _ MySQL

Source: Internet
Author: User
Tags localhost mysql
How to install MySQL5.5 in CentOS 5.5

BitsCN.com

Open Terminal

Switch to the root directory

[Shell @ localhost ~] # Su-uninstall Mysql5.0 from CentOS before installing Mysql5.5.

[Root @ localhost ~] # Yum remove mysql

Install cmake

Download the cmakesource code package cmake-2.8.5.tar.gz

[Root @ localhost ~] # Wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gzcompilation install unzip root@localhost#tar xzvf cmake-2.8.5.tar.gz [root @ localhost] # cd cmake-2.8.5 [root @ localhost cmake-2.8.5] #. /bootstrap Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. please specify one using environment variable CC. see cmake_bootstrap.log for compilers attempted. error: The C compiler is missing.

Solution: install the gcc compiler.

It can be installed from the installation disk of the Linux system, or simply by using yum

[Root @ localhost ~] # Yum install gcc

Continue cmake installation

[Root @ localhost cmake-2.8.5] #. /bootstrap Error when bootstrapping CMake: Cannot find appropriate C ++ compiler on this system. please specify one using environment variable CXX. see cmake_bootstrap.log for compilers attempted. another error is reported: The C ++ compiler is missing.

Install the gcc-c ++ compiler

It can also be installed from the installation disk of the Linux system, or simply by using yum

[Root @ localhost ~] # Yum install gcc-c ++

Repeat the preceding operations

[Root @ localhost cmake-2.8.5] #./bootstrap

After no error is reported, compile and install

[Root @ localhost cmake-2.8.5] # make [root @ localhost cmake-2.8.5] # make install [root @ localhost cmake-2.8.5] # cmake-version

Start to officially install Mysql

Add mysql users and user groups

[Root @ localhost ~] # Groupadd mysql [root @ localhost ~] # Useradd-g mysql

Download the MySQL source code package mysql-5.5.27.tar.gz

[Root @ localhost ~] # Wget http://dev.mysql.com/downloads/mysql-5.5/mysql-5.5.27.tar.gzunzip

[Root @ localhost ~] # Cd/usr/local/[root @ localhost local] # tar xzvf mysql-5.5.27.tar.gz [root @ localhost local] # cd mysql-5.5.27

Run cmake

[Root @ localhost mysql-5.5.27] # cmake.

Error:

-- 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/re Adline. cmake: 216 (MYSQL_USE_BUNDLED_LIBEDIT) CMakeLists.txt: 250 (MYSQL_CHECK_READLINE) -- inserting ing incomplete, errors occurred!

Solution:

[Root @ localhost mysql-5.5.27] # rm CMakeCache.txt [root @ localhost mysql-5.5.27] # yum-y install ncurses-devel *

Run cmake again

[Root @ localhost mysql-5.5.27] # cmake. there is still a warning

Warning: Bison executable not found in PATH has a Warning and solves it. if Bison is missing, install it.

[Root @ localhost mysql-5.5.27] # yum install bison

Run again, no error reported

[Root @ localhost mysql-5.5.27] # cmake. you can set the installation configuration options before compiling and installation

[Root @ localhost mysql-5.5.27] #./configure -- help select the option you need to set based on the help information, of course, you can skip this step, by default settings


# Start compilation and installation. The time is a little longer...

[Root @ localhost mysql-5.5.27] # make & make install complete compilation and installation

Go to the installation directory, change the binary ownership of the program to root, change the ownership of the data directory to mysql User, and update the authorization table.

[Root @ localhost mysql-5.5.27] # cd/usr/local/mysql [root @ localhost mysql] # chown-R root. [root @ localhost mysql] # chown-R mysql. [root @ localhost mysql] # chgrp-R mysql. [root @ localhost mysql] # scripts/mysql_install_db -- user = mysql initialization database [root @ localhost mysql] #/usr/local/mysql/scripts/mysql_install_db -- user = mysql -- basedir = /usr/local/mysql -- datadir =/usr/local/mysql/data to start mysql safely

[Root @ localhost mysql] #./bin/mysqld_safe -- user = mysql disable mysql

[Root @ localhost mysql] #./bin/mysqladmin-u root shutdown-p default password is empty for convenient calling, set a soft link for mysql [root @ localhost ~] # Ln-s/usr/local/mysql/bin/mysql/usr/bin/mysql

Other settings:

Set the option file and copy the configuration file to/etc.

[Root @ localhost mysql] # cp support-files/my-medium.cnf/etc/mysql. cnf is set to boot automatically [root @ localhost mysql] # cp support-files/mysql. server/etc/init. d/mysql [root @ localhost mysql] # chmod + x/etc/init. d/mysql [root @ localhost mysql] # chkconfig

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.