Install MySQL 5.5 in Linux source code

Source: Internet
Author: User
Tags mysql commands

Install MySQL 5.5 in Linux source code

This article describes how to install mysql5.5 in the source code. The system used is CentOS6.5.

1. Install the corresponding development environment
Yum install-y ncurses-devel
Yum install-y libaio
Yum install-y bison
Yum install-y gcc-c ++
Yum install-y openssl-devel

Ii. Install cmake

Cross-platform Compiler
# Tar xf cmake-2.8.8.tar.gz
# Cd cmake-2.8.8
#./Bootstrap
# Make
# Make install
You can also use yum or rpm for installation.
Yum install-y cmake

-------------------------------------- Split line --------------------------------------

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

MySQL-5.5.38 universal binary Installation

-------------------------------------- Split line --------------------------------------

3. Compile and install mysql-5.5.33

1. Compile and install
# Groupadd-r mysql
# Useradd-g mysql-r-d/mydata/data mysql
# Tar xf mysql-5.5.33.tar.gz
# Cd mysql-5.5.33
# Cmake. -DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/mydata/data-DSYSCONFDIR =/etc-region = 1-region = 1-region = 1-DWITH_READLINE = 1-DWITH_SSL = system-DWITH_ZLIB = system-DWITH_LIBWRAP = 0-DMYSQL_UNIX_ADDR =/tmp/mysql. sock-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci
# Make
# Make install

2. Change the owner of all mysql files to root and the group to mysql.
# Cd/usr/local/mysql
# Chown-R. mysql.

3. Copy the my-large.cnf in support-files to/etc/my. cnf (it is best to back up my. cnf in the actual production environment) and modify my. cnf
# Cp support-files/my-large.cnf/etc/my. cnf
# Vim/etc/my. cnf
Add datadir =/mydata/data

4. Manually initialize and copy mysql. server to/etc/rc. d/init. d/mysqld and add it to the service.
# Scripts/mysql_install_db -- user = mysql -- datadir =/mydata/data/
# Cp support-files/mysql. server/etc/rc. d/init. d/mysqld
# Chmod + x/etc/rc. d/init. d/mysqld
# Chkconfig -- add mysqld
# Vim/etc/profile. d/mysql. sh

Now, you can use mysql commands and services:

Start the service:

Mysql client command:

 

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.