LAMP指的Linux(操做系统)、Apache(httpd 服务器),MySQL(数据库软件) 和PHP(有时也是指Perl或Python) 的缩写,通常用来创建web 服务器(三个角色能够在一台机器也能够分开,可是Apache和PHP要安装在一块儿) 。css
说明: 服务器上的图片、js、css等文件属于静态文件;数据库文件是动态文件。mysql
MySQL 是一种关联数据库管理系统,关联数据库将数据保存在不一样的表中,而不是将全部数据放在一个大仓库内,这样就增长了速度并提升了灵活性。linux
MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护。MariaDB直到5.5版本,均依照MySQL的版本。从2012年11月12日起发布的10.0.0版开始,再也不依照MySQL的版号。10.0.x版以5.5版为基础,加上移植自MySQL5.6版的功能和自行开发的新功能。web
MySQL版本:
community 社区版;enterprise 企业版;GA(generally available) 通用版,在生产环境中使用;DMR(development milestone release) 开发里程碑版本;RC(release candidate) 发行候选版本;Beta 开放测试版本;Alpha 内部测试版本。sql
uname命令用于打印当前系统相关信息(内核版本号、硬件架构、主机名称和操做系统类型等)。数据库
语法: uname [options]
Options:
-a:=all,显示所有信息
-m:=machine,显示电脑类型
-n:显示在网络上的主机名
-r:显示操做系统的发行编号
-s:显示操做系统名称
-v:显示操做系统版本
-p:显示处理器类型或“unknown”
-i:输出硬件平台
-o:输出操做系统名称vim
rpm包、源码包、二进制免编译包。安全
MySQL-5.6-64位二进制免编译包镜像下载地址:http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz服务器
[root@1 ~]# cd /usr/local/src/
[root@1 src]# wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
[root@1 src]# tar zxvf /usr/local/src/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
[root@1 src]# mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql
[root@1 mysql]# cd /usr/local/mysql/
[root@1 mysql]# useradd mysql
[root@1 mysql]# mkdir /data/
[root@1 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
错误排查网络
[root@1 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db: Data::Dumper
解决办法:
根据提示搜索相应的安装包并进行安装: [root@1 mysql]# yum install -y perl-Data-Dumper
[root@1 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
解决办法:
根据提示信息安装有关的库文件: [root@1 mysql]# yum -y install libaio* libaio-dev*
完成上述操做后先检测"./scripts"命令是否正确执行:
[root@1 mysql]# echo $? 0
[root@1 mysql]# cp support-files/my-default.cnf /etc/my.cnf
将模板中内容改为以下格式: [root@1 mysql]# vim /etc/my.cnf [mysqld] datadir=/data/mysql socket=/tmp/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld_safe] #log-error=/var/log/mariadb/mariadb.log #pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # #!includedir /etc/my.cnf.d
将启动脚本添加到系统配置文件/etc/init.d/中: [root@1 mysql]# cp support-files/mysql.server /etc/init.d/mysqld 修改配置文件: [root@1 mysql]# vim /etc/init.d/mysqld …… basedir=/usr/local/mysql datadir=/data/mysql …… 更改配置文件权限(默认状况是755): [root@1 mysql]# chmod 755 /etc/init.d/mysqld 此步骤能够省略!
将MySQL服务添加到开机启动服务中: [root@1 mysql]# chkconfig --add mysqld [root@1 mysql]# chkconfig --list mysqld 0:关 1:关 2:开 3:开 4:开 5:开 6:关 netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关 network 0:关 1:关 2:开 3:开 4:开 5:开 6:关 启动MySQL服务: 方法1: [root@1 mysql]# /etc/init.d/mysqld start 方法2: [root@1 mysql]# service mysqld start Starting MySQL.Logging to '/data/mysql/adai003.err'. .. SUCCESS!
[root@1 mysql]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql & # 后台执行该命令
kill命令和killall命令都是用来杀死系统中的进程,区别是: