CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Centos 源码安装 MySQL大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

系统环境:Centos6.5 1、下载源码包 [monster@localhost download]$ wget http://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/ [

系统环境: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

4、更改MysqL目录所属组和@L_772_14@

[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

9、设置数据库root密码,登录MysqL

[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,请注明来意。