设为首页 收藏本站
查看: 724|回复: 0

[经验分享] LAMP架构介绍、MySQL,MariaDB介绍、MySQL安装

[复制链接]

尚未签到

发表于 2018-10-7 09:59:28 | 显示全部楼层 |阅读模式
  LAMP架构介绍
  LAMP指的L(linux)、A(Apache)、M(mysql)、P(php);apache+php需要在一台主机,mysql可以分开也可以在同一台主机上运行。
  工作模式如下:
DSC0000.png

  静态文件:图片、文档,不用通过加载mysql去取数据
  动态文件:js等通过php模块调用mysql,再通过apache展示来实现的动态资源
  MySQL,MariaDB介绍
  mysql:关系型数据库,由sun公司研发,后被oracle公司收购;
  其版本:
  community 社区版;enterprise 企业版;GA(generally available) 通用版,在生产环境中使用;DMR(development milestone>
  MariaDB:和mysql基本一致,是mysql的一个分支。
  MySQL安装
  常用的安装包:
  rpm包(rpm -ivh 安装)
  源码包(源代码编译安装,耗时比较久,一般也得20多分钟)
  二进制免编译包(已经编译好的,拿来就可以直接使用,简单快速安装)
  1、下载安装包(二进制免编译包):
  [root@centos7 package]# wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
  2、解压
  [root@centos7 package]# tar xf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
  3、[root@centos7 package]# mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql
  4、创建mysql、data目录
  [root@centos7 mysql]# useradd mysql
  [root@centos7 mysql]# mkdir /data/
  5、安装相应的软件包
  [root@centos7 mysql]# yum install -y perl-Data-Dumper libaio* libaio-dev*
  6、初始化
  [root@centos7 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
  7、验证是否正确
  [root@centos7 mysql]# echo $?
  0
  8、拷贝配置文件到/etc
  [root@centos7 mysql]# cp support-files/my-default.cnf  /etc/my.cnf
  cp: overwrite ‘/etc/my.cnf’? y
  9、新增datadir、socket:
  [root@centos7 mysql]# cat /etc/my.cnf
  # For advice on how to change settings please see
  # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
  # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
  # *** default location during install, and will be replaced if you
  # *** upgrade to a newer version of MySQL.
  [mysqld]
  datadir=/data/mysql
  socket=/tmp/mysql.sock
  # Remove leading # and set to the amount of RAM for the most important data
  # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  # innodb_buffer_pool_size = 128M
  10、启动脚本:
  [root@centos7 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
  [root@centos7 mysql]# vi /etc/init.d/mysqld
  basedir=/usr/local/mysql
  datadir=/data/mysql
  11、[root@centos7 mysql]# chmod 755 /etc/init.d/mysqld
  12、
  [root@centos7 mysql]# chkconfig --add mysqld
  [root@centos7 mysql]# chkconfig --list| grep mysqld
  Note: This output shows SysV services only and does not include native
  systemd services. SysV configuration data might be overridden by native
  systemd configuration.
  If you want to list systemd services use 'systemctl list-unit-files'.
  To see services enabled on particular target use
  'systemctl list-dependencies [target]'.
  mysqld         0:off1:off2:on3:on4:on5:on6:off
  13、启动
  [root@centos7 mysql]# /etc/init.d/mysqld start
  14、[root@centos7 mysql]# netstat -nutlp| grep mysqld
  tcp6       0      0 :::3306                 :::*                    LISTEN      18112/mysqld
  14、错误信息:
  [root@centos7 ~]# killall
  -bash: killall: command not found
  解决:[root@centos7 ~]# yum install psmisc -y
  15、[root@centos7 ~]# killall mysqld
  16、没有启动脚本时,如下启动:
  [root@centos7 ~]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql &
  17、[root@centos7 ~]# ps aux|grep mysql


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-614211-1-1.html 上篇帖子: centos7-源码安装mysql5.7 下篇帖子: mysql初学笔记1(来自runoob.com)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表