centos6.5 binary installation MySQL

Source: Internet
Author: User

[email protected] ~]# Yum install libaio-devel-y #安装共享库

[Email protected] ~]# wget http://mirrors.sohu.com/mysql/My ... ux2.6-x86_64.tar.gz #下载MySQL二进制包

[Email protected] ~]# tar xf mysql-5.5.48-linux2.6-x86_64.tar.gz #解压二进制包

[Email protected] ~]# mv Mysql-5.5.48-linux2.6-x86_64/usr/local/mysql #将二进制包移动到安装目录

[Email protected] ~]# useradd mysql-s/sbin/nologin-m #新建MySQL用户

[Email protected] ~]# chown-r mysql.mysql/usr/local/mysql/data/ #授权MySQL用户属主


initialize MySQL
[[email protected] ~]# cd/usr/local/mysql
[[email protected] mysql]#./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/ local/mysql/data/

[Email protected] mysql]# \CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF#拷贝MySQL配置文件
[Email protected] mysql]# cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld #拷贝MySQL启动文件
[Email protected] mysql]#/etc/init.d/mysqld start #启动MySQL
[Email protected] mysql]# chkconfig mysqld on #设置开机启动

[Email protected] mysql]# vi/etc/profile.d/mysql.sh #设置mysql环境变量. Add the following content

Export path= $PATH:/usr/local/mysql/bin

[Email protected] mysql]# source/etc/profile.d/mysql.sh #执行命令使用其生效

[Email protected] mysql]#/usr/lcoal/mysql/bin/mysql_secure_installation #安全配置向导


[[email protected] mysql]# netstat-lntup|grep MySQL
TCP 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1545/mysqld
[Email protected] mysql]# mysql-uroot-p #登录MySQL


Click copy code, Paste to command line execute.

  1. Yum Install Libaio-devel wget-y

  2. wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.48-linux2.6-x86_64.tar.gz

  3. Tar XF mysql-5.5.48-linux2.6-x86_64.tar.gz

  4. MV Mysql-5.5.48-linux2.6-x86_64/usr/local/mysql

  5. Useradd mysql-s/sbin/nologin-m

  6. Chown-r mysql.mysql/usr/local/mysql/data/

  7. Cd/usr/local/mysql

  8. ./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data/

  9. \cp/usr/local/mysql/support-files/my-small.cnf/etc/my.cnf

  10. Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

  11. Cp-a/usr/local/mysql/bin/*/usr/local/sbin/

  12. chmod +x/etc/init.d/mysqld

  13. /etc/init.d/mysqld start

  14. Chkconfig mysqld on

  15. Mysqladmin-uroot password "AbC123456"

  16. Mysql-uroot-p "AbC123456"


centos6.5 binary installation MySQL

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.