2018.5.23 (Lamp architecture Introduction, MySQL, mariadb introduction, MySQL installation)

Source: Internet
Author: User
Tags mysql in

Lamp Architecture Introduction
LAMP是Linux apache MySQL php的简写,即可吧apache MySQL和PHP安装在Linux系统上,组成一个坏境来运行PHP的脚本语言,通常是网站。Linux是操作系统apache提供web的一个软件MySQL 存储的一个软件,数据库PHP 脚本语言 三个角色可以在一台机器,也可以分开。不过 MySQL和PHP要在一起。

For example, if you point a picture logo on a web site Apache will take it in a static resource, not in MySQL.
If in a forum to write to the post, the contents of the data will be stored in the MySQL database, this time again want to read, you have to go through MySQL, through the dynamic to get the data.

Mysql--maria DB Introduction
MySQL介绍:MySQL是一个关系型数据库,由MySQL ab公司开发,MySQL在2008年被sun公司10亿$收购,2009年sun公司被Oracle公司收购(74亿$)MySQL官网:https//:www.mysql.comcommunity 社区版本,Enterprise 企业版, GA(Generally Available)通用版本,生产环境中用。DMR(Development Milestone Release)开发里程碑发布版。RC(release candidate) 发行候选版本,beta开发测试版本(对外),alpha内部测试版本。
MySQL Installation
介绍:我们平时是通过源码包安装MySQL,由于它的编译时间比较长,通常用二进制免编译包。源码包都是可以更改的C或者C++语言编写的源码文件。而免编译的二进制包就是已经编译过的文件再打包提供给我们似乎用的。MySQL版本比较多,并不是用最新的才更好,因为新版本难免会有一些bug。

Several common installation packages for MySQL: RMP, source code, binary-free compilation

How many bits of your operating system are you looking at?
    [[email protected] ~]# uname -i    x86_64
Go to the directory and suggest that all packages will be placed in this directory later/USR/LOCAL/SRC
    [[email protected] ~]# cd /usr/local/src/ #进入到目录下    [[email protected] src]# pwd #查看当前的位置    /usr/local/src
Download the source Package
     
Extract
    [[email protected] src]#tar zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
Reposition and rename
    [[email protected] src]# mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql
Enter into the Usr/local/mysql directory, to confirm that the directory has bin data and other directories
    [[email protected] src]# cd /usr/local/mysql/    [[email protected] mysql]# ls    bin  COPYING  data  docs  include  lib  man  mysql-test  README  scripts  share  sql-bench  support-files

Create a MySQL user
    [[email protected] mysql]# useradd mysql
Create a data directory where the database files will be placed
    [[email protected] mysql]# mkdir data #这里面已经存在了,不需要再次创建    mkdir: 无法创建目录"data": 文件已存在
Specify the user for MySQL in the specified DataDir (database directory, assigned to directory, directory does not exist, the previous level directory exists automatically created)
    [[email protected] 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 #少了一个模块,dumper
We can use a command blur to find the package we need
    [[email protected] mysql]# yum list |grep prel |grep -i dumper     yum list在库中查找,grep prel过滤出prel的包,grep -i dumper不分大小写列出来。
There is also a way to install the autoconf library
    命令:yum -y install autoconf   //此包安装时会安装Data:Dumper模块
Execute again
[[email protected] mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data
Check that the previous command is correct
    [[email protected] mysql]# echo $?    0
Copy configuration file
    [[email protected] mysql]# ls support-files/my-default.cnf     support-files/my-default.cnf    [[email protected] mysql]# cp support-files/my-default.cnf /etc/my.cnf     cp:是否覆盖"/etc/my.cnf"? y
Vim for editing, edit content as follows

Start the script file and modify its properties
    [[email protected] mysql]# ls support-files/ #查看这个目录下都有哪些文件    binary-configure  magic  my-default.cnf  mysqld_multi.server  mysql-log-rotate  mysql.server    [[email protected] mysql]# cp support-files/mysql.server /etc/init.d/mysqld     #把mysql.server拷贝到/etc/init.d/mysqld下面去
Permission Change 755
    [[email protected] mysql]# ls -l /etc/init.d/mysqld     -rwxr-xr-x. 1 root root 10875 5月  25 02:40 /etc/init.d/mysqld
modifying startup scripts
    vim /etc.init,d/mysqld

If you want to set the startup script if the system service item, boot up and start the MySQL operation as follows:
    [[email protected] mysql]# chkconfig --add mysqld #把mysqld服务假如到系统服务列表中    [[email protected] mysql]# chkconfig mysqld on #使其开机启动    [[email protected] mysql]# service mysqld start #启动服务

Operation failed, did not start up, Saturday review.

2018.5.23 (Lamp architecture Introduction, MySQL, mariadb introduction, MySQL installation)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.