MySQL binary package installation and configuration combat record

Source: Internet
Author: User
Tags chmod mysql login

Guide In general, the development of small and medium-sized web sites have chosen MySQL as the site database, because of its community edition of Performance Excellence, with PHP, Linux and Apache can form a good development environment, after years of web technology development, in the industry is widely used in one of the Web server solutions. But MySQL source package compilation time is too long, today will be the binary package to install MySQL, and optimize the configuration, I hope to the vast number of readers have reference significance.

1. Create a MySQL user first before installing
[Email protected]_nfs ~]# useradd mysql-s/sbin/nologin-m [[email protected]_nfs ~]# ID mysqluid=500 (mysql) gid=500 (mys QL) groups=500 (MySQL)
2. Download and unzip the package
[[Email Protected]_nfs ~]# mkdir/home/chenfan/tools  -p[[email protected]_nfs ~]# cd/home/chenfan/tools in HTTP// dev.mysql.com/downloads/mysql/official website Download mysql-5.5.32-linux2.6-x86_64.tar.gz[[email protected]_nfs tools]# ls Mysql-5.5.32-linux2.6-x86_64.tar.gz[[email Protected]_nfs tools]# tar zxvf mysql-5.5.32-linux2.6-x86_64.tar.gz [[ email protected]_nfs tools]# ls mysql-5.5.32-linux2.6-x86_64  mysql-5.5.32-linux2.6-x86_64.tar.gz[[email Protected]_nfs local]# mv mysql-5.5.32-linux2.6-x86_64/usr/local/mysql-5.5.32  # # #免编译安装 [[Email Protected]_nfs local]# cd/usr/local[[email protected]_nfs local]# ln-s mysql-5.5.32  mysql   # # #此处的软链接为了版本升级提供了便利
3. Initializing the database
[Email protected]_nfs local]# mysql/scripts/mysql_install_db  --basedir=/usr/local/mysql/--datadir=/usr/local /mysql/data/  --user=mysql # # #此处如果初始化发生错误, delete the contents of the Data directory, RM-FR  mysql/data/*, reinitialize.
4. Generate MySQL configuration file
[Email protected]_nfs local]# CD mysql[[email PROTECTED]_NFS mysql]# CP support-files/my-small.cnf  
5. Authorization Management Files
[Email protected]_nfs ~]# chown-r mysql:mysql/usr/local/mysql/[[email protected]_nfs ~]# ls-ld/usr/local/mysql/drwxr -xr-x. MySQL MySQL 4096 June 17:21/usr/local/mysql/
6. Set up the scientific way to start
[Email protected]_nfs mysql]# CP support-files/mysql.server  /etc/init.d/mysqld [email Protected]_nfs mysql]# chmod +x/etc/init.d/mysqld [[email Protected]_nfs mysql]#/etc/init.d/mysqld start starting mysql ... success! [Email protected]_nfs mysql]# chkconfig--add mysqld [[email Protected]_nfs mysql]# chkconfig mysqld on [[email protected ]_nfs mysql]# chkconfig--list mysqld mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off### Set the boot-up from MySQL
7. Configure the MySQL environment variable
[Email Protected]_nfs mysql]# echo ' path=/usr/local/mysql/bin: $PATH ' >>/etc/profile [email Protected]_nfs mysql]# source/etc/profile [[email Protected]_nfs mysql]# echo $PATH/usr/local/mysql/bin:/usr/local/sbin:/usr/local/ bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin## #此处PATH路径的设置为了后续mysql命令的使用
8.mysql Login and password settings
 [[Email protected]_nfs mysql]# mysqlwelcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 1Server version:5.5.32 mysql Community Server (GPL) Copyright (c) +, Oracle and /or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> [[Email protected]_nfs mysql]# mysqladmin-uroot Password ' Chenfan ' # # #密码的设置 [[Email protected]_nfs mysql]# Mysql-uroot-penter password:chenfan## #交互式登陆 # # # Complete the initial installation and configuration of MySQL 
Guide In general, the development of small and medium-sized web sites have chosen MySQL as the site database, because of its community edition of Performance Excellence, with PHP, Linux and Apache can form a good development environment, after years of web technology development, in the industry is widely used in one of the Web server solutions. But MySQL source package compilation time is too long, today will be the binary package to install MySQL, and optimize the configuration, I hope to the vast number of readers have reference significance.

1. Create a MySQL user first before installing
[Email protected]_nfs ~]# useradd mysql-s/sbin/nologin-m [[email protected]_nfs ~]# ID mysqluid=500 (mysql) gid=500 (mys QL) groups=500 (MySQL)
2. Download and unzip the package
[[Email Protected]_nfs ~]# mkdir/home/chenfan/tools  -p[[email protected]_nfs ~]# cd/home/chenfan/tools in HTTP// dev.mysql.com/downloads/mysql/official website Download mysql-5.5.32-linux2.6-x86_64.tar.gz[[email protected]_nfs tools]# ls Mysql-5.5.32-linux2.6-x86_64.tar.gz[[email Protected]_nfs tools]# tar zxvf mysql-5.5.32-linux2.6-x86_64.tar.gz [[ email protected]_nfs tools]# ls mysql-5.5.32-linux2.6-x86_64  mysql-5.5.32-linux2.6-x86_64.tar.gz[[email Protected]_nfs local]# mv mysql-5.5.32-linux2.6-x86_64/usr/local/mysql-5.5.32  # # #免编译安装 [[Email Protected]_nfs local]# cd/usr/local[[email protected]_nfs local]# ln-s mysql-5.5.32  mysql   # # #此处的软链接为了版本升级提供了便利
3. Initializing the database
[Email protected]_nfs local]# mysql/scripts/mysql_install_db  --basedir=/usr/local/mysql/--datadir=/usr/local /mysql/data/  --user=mysql # # #此处如果初始化发生错误, delete the contents of the Data directory, RM-FR  mysql/data/*, reinitialize.
4. Generate MySQL configuration file
[Email protected]_nfs local]# CD mysql[[email PROTECTED]_NFS mysql]# CP support-files/my-small.cnf  
5. Authorization Management Files
[Email protected]_nfs ~]# chown-r mysql:mysql/usr/local/mysql/[[email protected]_nfs ~]# ls-ld/usr/local/mysql/drwxr -xr-x. MySQL MySQL 4096 June 17:21/usr/local/mysql/
6. Set up the scientific way to start
[Email protected]_nfs mysql]# CP support-files/mysql.server  /etc/init.d/mysqld [email Protected]_nfs mysql]# chmod +x/etc/init.d/mysqld [[email Protected]_nfs mysql]#/etc/init.d/mysqld start starting mysql ... success! [Email protected]_nfs mysql]# chkconfig--add mysqld [[email Protected]_nfs mysql]# chkconfig mysqld on [[email protected ]_nfs mysql]# chkconfig--list mysqld mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off### Set the boot-up from MySQL
7. Configure the MySQL environment variable
[Email Protected]_nfs mysql]# echo ' path=/usr/local/mysql/bin: $PATH ' >>/etc/profile [email Protected]_nfs mysql]# source/etc/profile [[email Protected]_nfs mysql]# echo $PATH/usr/local/mysql/bin:/usr/local/sbin:/usr/local/ bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin## #此处PATH路径的设置为了后续mysql命令的使用
8.mysql Login and password settings
[Email Protected]_nfs mysql]# mysqlwelcome to the MySQL monitor.  Commands End With; or \g.your MySQL connection ID is 1Server version:5.5.32 mysql Community Server (GPL) Copyright (c) +, Oracle and /or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> [[email protected]_nfs mysql]# mysqladmin-uroot password  ' ch Enfan ' # # #密码的设置 [[email protected]_nfs mysql]# mysql-uroot-penter password:chenfan## #交互式登陆 # # #至此完成MySQL的全部初始安装与配置

MySQL binary package installation and configuration combat record

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.