Install Mysql 5.5 in CentOS

Source: Internet
Author: User


1. install cmake # install the required dependency package yum-y install gcc libxml2-dev curl screen \ libpng12-dev autoconf libpcre3-dev make bzip2 \ libevent-dev patch libjpeg62-dev libcurl4-openssl-dev libfreetype6-dev \ libncurses5-dev g + + libtool psmisc lrzsz # download file wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz Www.2cto.com # compile and install tar zxvf cmake-2.8.5.tar.gzcd cmake-2.8.5./boostarpmakemake installcmake-version 2. install and configure mysql # download source file wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz/from/ftp://ftp.ntu.edu.tw/pub/MySQL/# Or wget ftp://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz # Create a user and group groupadd mysqluseradd-g mysql-s/usr/sbin/nologin mysql # create the installation directory mkdir/usr/local/mysql # create the database directory mkdir/usr/local/ mysql/data www.2cto.com # unzip tar-zxvf mysql-5.5.17.tar.gzcd mysql-5.5.17 # compile and install mysql # cmake compile: cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-plugin =/usr/local/mysql/data \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = bytes \-DWITH_READLINE = 1 \-DWITH_SSL = system \
-Plugin = 1 \-DENABLED_LOCAL_INFILE = 1 \-DDEFAULT_COLLATION = utf8_general_ci \-plugin = 1 \-plugin = 1 \-DWITH_DEBUG = 0 www.2cto.com # install mysqlmake & make install # copy configuration file cp support-files/my-medium.cnf/etc/my. cnf # Set the permission chmod + x/usr/local/mysqlchown-R mysql. mysql/usr/local/mysqlchown-R mysql: mysql/usr/local/mysql/data # Configure Automatic startup cp support-files/mysql. server/etc/init. d/mysqldchmod + x/etc/init. d/mysqldchkconfig-add mysqldchkconfg mysqld on www.2cto.com # modify my. configure vim/etc/my. cnf # [mysqld] Add: datadir =/usr/local/mysql/datadefault-storage-engine = MyISAM # The following are optional: log-error =/usr/local/mysql/data/error. logpid-file =/usr/local/mysql/data/mysql. piduser = mysqltmpdir =/tmp # initialize the database/usr/local/mysql/scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/usr/local/ mysql/data & # Start MySQL/usr/local/mysql/bin/mysqld_safe-defaults-file =/etc/my. cnf & or:/etc/init. d/mysql start (service mysql start) www.2cto.com # test whether MySQL is started #1) check whether the process mysqlps-ef | grep mysql #2) check whether the port is running netstat-tnl | grep 3306 #3) read mysql version information/usr/local/mysql/bin/mysqladmin version # so far, MySQL installation is complete
 

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.