Centos compilation and installation of mysql5.5

Source: Internet
Author: User
Tags localhost mysql mysql download


Before installing mysql5.5 in centos compilation and installation, uninstall Mysql5.0 in CentOS. [Root @ localhost ~] # Yum remove mysql compile and install cmake www.2cto.com download the cmakesource code package cmake-2.8.4.tar.gz, mv to the/usr/local/src directory [root @ localhost ~] # Cd/usr/local/src/[root @ localhost src] # tar xzvf cmake-2.8.4.tar.gz [root @ localhost src] # cd cmake-2.8.4 [root @ localhost cmake-2.8.4] #. /bootstrap ------------------------------------------- CMake 2.8.4, Copyright 2000-2009 Kitware, Inc. --------------------------------------------- Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. please specify one using envi Ronment variable CC. See cmake_bootstrap.log for compilers attempted. Sort Log of errors:/usr/local/src/cmake-2.8.4/Bootstrap. cmk/cmake_bootstrap.log handler error: C compiler missing. You can install the gcc compiler on www.2cto.com from the installation disk of the Linux system, or simply use yum to install [root @ localhost ~]. # Yum install gcc continue the installation of cmake [root @ localhost cmake-2.8.4] #. /bootstrap ------------------------------------------- CMake 2.8.4, Copyright 2000-2009 Kitware, Inc. C compiler on this system is: cc --------------------------------------------- Error when bootstrapping CMake: Cannot find appropriate C ++ compiler on this system. please specify one using environment variable CXX. see cmake_bootstrap.lo G for compilers attempted. ------------------------------------------- Log of errors:/usr/local/src/cmake-2.8.4/Bootstrap. cmk/cmake_bootstrap.log handler again reported the error: C ++ compiler missing. The gcc-c ++ compiler www.2cto.com can also be installed from the installation disk of the Linux system, or simply install [root @ localhost ~] With yum. # Yum install gcc-c ++ repeat the operation above [root @ localhost cmake-2.8.4] #. /bootstrap no error reported, compile and install [root @ localhost cmake-2.8.4] # gmake [root @ localhost cmake-2.8.4] # gmake install start to formally install Mysql add mysql user and user group [root @ localhost ~] # Groupadd mysql [root @ localhost ~] # Useradd-g mysql download the mysql source code package mysql-5.11.tar.gz to/usr/local/src, decompress [root @ localhost ~] # Cd/usr/local/src/[root @ localhost src] # tar xzvf mysql-5.5.11.tar.gz [root @ localhost src] # cd mysql-5.5.11 cmake run [root @ localhost mysql-5.5.11] # cmake. error: www.2cto.com -- 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 Deb Ian/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) -- inserting ing incomplete, errors occurred!
The Curses package is missing. Solution: remove CMakeCache.txt and rerun cmake. on Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel. it's easy to understand, not to explain... in CentOS, you need to install ncurses-devel [root @ localhost mysql-5.5.11] # yum install ncurses-devel re-cmake run [root @ localhost mysql-5.5.11] # cmake. www.2cto.com still has a Warning: Bison executable not found in PATH has a Warning, but also solves it. If Bison is missing, install [root @ localhost mys Ql-5.5.11] # yum install bison run again, no error [root @ localhost mysql-5.5.11] # cmake. before compilation and installation, you can set the installation configuration option [root @ localhost mysql-5.5.11] #. /configure -- help select the options you need to set based on the help information. Of course, you can skip this step and start the compilation and installation according to the default settings. The time is a little longer. You can leave a cup of coffee for a while... [root @ localhost mysql-5.5.11] # make & make install complete the compilation and installation of www.2cto.com to enter the installation directory, change the ownership of the binary program to root, the data directory has the right to change to mysql user, update authorization table [root @ localhost mysql-5.5.11] # cd/usr/local/mysql/[root @ localhost mys Ql] # chown-R root. [root @ localhost mysql] # chown-R mysql. [root @ localhost mysql] # chgrp-R mysql. [root @ localhost mysql] # scripts/mysql_install_db -- user = mysql safe start mysql [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 there are three ways to set a password for the root account: use the set password statement [root @ localhost ~] At www.2cto.com # Mysql-u rootmysql> set password for 'root' @ 'localhost' = PASSWORD ('newpwd '); mysql> set password for 'root' @ 'host _ name' = PASSWORD ('newpwd') use the mysqladmin command line program [root @ localhost ~] # Mysqladmin-u root password "newpwd" [root @ localhost ~] # Mysqladmin-u root-h host_name password "newpwd" Use the UPDATE statement [root @ localhost ~] # Mysql-u rootmysql> UPDATE mysql. user SET Password = PASSWORD ('newpwd')-> WHERE User = 'root'; mysql> flush privileges; other settings: SET the option file, copy the configuration file to/etc [root @ localhost mysql] # cp support-files/my-medium.cnf/etc/mysql. cnf is set to automatically start www.2cto.com [root @ localhost mysql] # cp support-files/mysql. server/etc/init. d/mysql [root @ localhost mysql] # chmod + x/etc/init. d/mysql can now start and close Mysql through the service [root @ localhost ~] # Service mysql start [root @ localhost ~] # The installation of service mysql shutdown is basically like this
 

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.