02-mysql-installation_mysql

Source: Internet
Author: User
02-mysql-installation 02-mysql-installation ---- MySQL installation version And technical documents
Mysql current common version mysql-5.6.15.tar.gz



---- MySQL compilation and installation
1.Installation environment requirements: mysql users and groups with the ID 27. install the software make, cmake, gcc, gcc-c ++, ncurses-devel, and bison. Groupadd-g 27 mysqluseradd-u 27-g mysql-s/sbin/nologin-M mysql
2.Create the installation directory/usr/local/mysql5.6, data directory/database, PID directory/var/run/mysqld, log directory/var/log/mysqld. Configuration file directory/usr/local/mysql5.6/etc 3.Cmake-LH merge cmakecache.txt, which is compiled according to the cache file in make (this is the default one, and step 4 is recommended ).
4.Define the cmakecache.txt file
Cmake/
-DCMAKE_INSTALL_PREFIX: PATH =/usr/local/mysql5.6/specify the installation PATH
-DMYSQL_DATADIR: PATH =/database/specifies the database PATH
-DSYSCONFDIR: PATH =/usr/local/mysql5.6/etc/specify the configuration file PATH
-DWITH_DEBUG: BOOL = on: enables debugging.
5.Compile software make
6.Install the software make install
7.MySQL configuration file modification/usr/local/mysql5.6/etc/my. cnf
[Mysqld]
Basedir =/usr/local/mysql5.6
Datadir =/database
Socket =/var/run/mysqld/mysql5.6.sock
Pid-file =/var/run/mysqld/mysql5.6.pid
Port = 3307 the default value is 3306.
User = mysql
[Mysqld_safe]
Log-error =/var/log/mysqld/mysql5.6-error. log
8.Grant mysql permissions to related directories
Chown-R myslq. mysql/usr/local/mysql5.6/database/var/run/mysqld // var/log/mysqld
9.Execute the mysql_install_db script file
/Usr/local/mysql5.6/scripts/mysql_install_db -- basedir =/usr/local/mysql5.6 -- datadir =/database -- user = mysql
10.Copy the startup command file to the system directory
Cp/usr/local/mysql5.6/support-files/mysql. server/etc/rc. d/init. d/mysql5.6 or/etc/init. d/mysqld
11.Set mysql startup and myslqd startup
Chkconfig -- add mysql5.6
Service mysql5.6 start
12.Configure the environment variable to add/usr/local/mysql5u6/bin to the profile.
Export PATH = $ PATH:/usr/local/mysql5u6/bin
Make the file take effect
Source/etc/profile








03-mysql-automatic installation script
#! /Bin/bash
# Comment
#. Mysql-5.6.sh mysql-5.6.15.tar.gz
#: Set ff = unix
#: Set nobomb

Name1 = "$1"
Name2 = $ {name1/.tar.gz
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.