centos6.5二进制安装mysql

前端之家收集整理的这篇文章主要介绍了centos6.5二进制安装mysql前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

[root@rsync ~]# yum install libaio-devel -y #安装共享库

[root@rsync ~]# wgethttp://mirrors.sohu.com/mysql/My... ux2.6-x86_64.tar.gz#下载MysqL二进制包

[root@rsync ~]# tar xf MysqL-5.5.48-linux2.6-x86_64.tar.gz#解压二进制包

[root@rsync ~]# mv MysqL-5.5.48-linux2.6-x86_64 /usr/local/MysqL#将二进制包移动到安装目录

[root@rsync ~]# useradd MysqL -s /sbin/nologin -M#新建MysqL用户

[root@rsync ~]# chown -R MysqL.MysqL /usr/local/MysqL/data/#授权MysqL用户属主


初始化MysqL
[root@rsync ~]# cd /usr/local/MysqL
[root@rsync MysqL]# ./scripts/MysqL_install_db --user=MysqL --basedir=/usr/local/MysqL --datadir=/usr/local/MysqL/data/

[root@rsync MysqL]# \cp /usr/local/MysqL/support-files/my-small.cnf /etc/my.cnf#拷贝MysqL配置文件
[root@rsync MysqL]# cp /usr/local/MysqL/support-files/MysqL.server /etc/init.d/MysqLd#拷贝MysqL启动文件
[root@rsync MysqL]# /etc/init.d/MysqLd start#启动MysqL
[root@rsync MysqL]#chkconfig MysqLd on #设置开机启动

[root@rsync MysqL]#vi /etc/profile.d/MysqL.sh#设置MysqL环境变量。添加如下内容

export PATH=$PATH:/usr/local/MysqL/bin

[root@rsync MysqL]#source /etc/profile.d/MysqL.sh#执行命令使用其生效

[root@rsync MysqL]# /usr/lcoal/MysqL/bin/MysqL_secure_installation #安全配置向导


[root@rsync MysqL]# netstat -lntup|grep MysqL
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1545/MysqLd
[root@rsync MysqL]# MysqL-uroot -p #登录MysqL


点击下面的复制代码粘贴至命令行执行即可。

  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"

原文链接:https://www.f2er.com/centos/382218.html

猜你在找的CentOS相关文章