Mysql Source Package Installation

Source: Internet
Author: User

MSYQL Server: mysql-5.5.30.tar.gz

Before installation, if a MySQL user is not present, the established

[[email protected] ~]# useradd MySQL
[[email protected] ~]# vim/etc/passwd #不让 mysql User login system

Change to: Mysql:x:501:501::/home/mysql:/sbin/nologin

Unzip the installation

[email protected] ~]# tar zxvf mysql-5.5.30.tar.gz-c/usr/local/src/

[email protected] ~]# cd/usr/local/src/mysql-5.5.30/

Compile, install:

Mysql 5.5.15 uses a new CMake compilation method, so install CMake first

[email protected] mysql-5.5.30]# yum install-y cmake

To start compiling:

[email protected] mysql-5.5.30]# mkdir/server/

[email protected] mysql-5.5.30]# cmake-dcmake_install_prefix=/server/mysql-5.5-dmysql_unix_addr=/tmp/ Mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dwith_extra_charsets=all-dwith_myisam_ Storage_engine=1-dwith_innobase_storage_engine=1-dwith_memory_storage_engine=1-dwith_readline=1-denabled_local _infile=1-dmysql_datadir=/server/mysql/data-dmysql_user=mysql

Installation:

[email protected] mysql-5.5.30]# make-j 4

[[email protected] mysql-5.5.30]# make install

Configure the MySQL runtime environment:

[email protected] mysql-5.5.30]# chown-r mysql:mysql/server/mysql-5.5/

#修改mysql安装目录权限, allow MySQL users to MySQL

The database folder reads and writes.

Copy MySQL configuration file

[Root[email protected] mysql-5.5.30]# cp/usr/local/src/mysql-5.5.30/support-files/my-large.cnf/etc/ My.cnf

To set up the mysqld5.5 service boot:

[email protected] mysql-5.5.30]# cp/usr/local/src/mysql-5.5.30/support-files/mysql.server/etc/init.d/ mysqld5.5

Copy the MySQL boot file, and you can use the service command to start and close MySQL later

[email protected] mysql-5.5.30]# chmod +x/etc/init.d/mysqld5.5
[email protected] mysql-5.5.30]# vim/etc/init.d/mysqld5.5

Basedir=

Datadir=

Modified to:

basedir=/server/mysql-5.5

Datadir=/server/mysql-5.5/data

To add a boot entry:

[email protected] ~]# chkconfig mysqld5.5 on
[email protected] ~]# chkconfig--list mysqld5.5
mysqld5.5 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off

Initialize MySQL database:

[email protected] ~]# cd/usr/local/src/mysql-5.5.30/scripts
[email protected] scripts]# chmod +x mysql_install_db

[email protected] scripts]#/mysql_install_db--defaults-file=/etc/my.cnf--basedir=/server/mysql-5.5-- Datadir=/server/mysql-5.5/data--user=mysql

Boot MySQL

[[email protected] scripts]#/etc/init.d/mysqld5.5 start

Test Login:

Set the MySQL root password

[email protected] ~]# mysqladmin-uroot password ' 123456 '

[email protected] ~]# mysql-u root-p123456


This article is from the Linux OPS blog, so be sure to keep this source http://linuxshare.blog.51cto.com/8944591/1671433

Mysql Source Package Installation

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.