大佬教程收集整理的这篇文章主要介绍了Centos 源码安装 MySQL,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
系统环境:Centos6.5
1、下载源码包
[monster@localhost download]$wgethttp://mirrors.sohu.com/MysqL/MysqL-5.5/MysqL-5.5.49-linux2.6-x86_64.tar.gz
解压到 /usr/local/ 目录下
[monster@localhost download]$ cd /usr/local/
[monster@localhost local]$ sudo tar -xf /opt/download/MysqL-5.5.49-linux2.6-x86_64.tar.gz
[monster@localhost local]$ sudo ln -s MysqL-5.5.49-linux2.6-x86_64/ MysqL
2、检查是否安装了相应的软件包
[monster@localhost local]$ sudo rpm -qa | grep -i MysqL
如果已安装了相应的xxxxx,为了防止安装时覆盖错误,先卸载xxxxx,注意加--nodeps选项,忽略依赖项
[monster@localhost local]$ sudo rpm -exxxxx --nodeps
/usr/local/MysqL目录结构
3、添加MysqL组和MysqL@L_772_14@,用于设置MysqL安装目录文件的所有者和所属组
[monster@localhost local]$ sudo groupadd MysqL
[monster@localhost local]$ sudo useradd -r -g MysqL
[monster@localhost local]$ cd MysqL
[monster@localhost MysqL]$ sudo chown -R MysqL:MysqL .
5、初始化数据库
[monster@localhost @H_318_20@mysql]$ sudoscripts/MysqL_install_db --user=MysqL
6、拷贝配置文件
[monster@localhost @H_318_20@mysql]$ sudo cp support-files/my-medium.cnf /etc/my.cnf
7、将MysqLd服务加入开机自启
[monster@localhost MysqL]$ sudo cp support-files/MysqL.server /etc/init.d/MysqLd
[monster@localhost MysqL]$ sudo chkconfig --add MysqLd
8、启动MysqLd服务
[monster@localhost MysqL]$ sudo service MysqLd start
[monster@localhost MysqL]$ sudo bin/MysqLadmin -u root password 'password'
[monster@localhost MysqL]$ bin/MysqL -u root -p
Enter password:
Welcome to the MysqL monitor. Commands end with ; or \g.
Your MysqL connection id is 3
Server version: 5.5.49-log MysqL Community Server (GPL)
Copyright (C) 2000,2016,Oracle and/or its affiliates. All rights reserved.
Oracle is a registered Trademark of Oracle Corporation and/or its
affiliates. Other names may be Trademarks of their respective
owners.
Type 'Help;' or '\h' for Help. Type '\c' to clear the current input statement. MysqL> quit Bye
以上是大佬教程为你收集整理的Centos 源码安装 MySQL全部内容,希望文章能够帮你解决Centos 源码安装 MySQL所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。