Lamp architecture Introduction, MySQL and mariadb introduction, MySQL Installation

Source: Internet
Author: User
Tags install perl

1, LAMP Architecture Introduction

LAMP is Linux, Apache, MySQL, PHP shorthand, is actually the Apache, MySQL and PHP installed on the Linux system, the formation of an environment to run PHP scripting language. As for what is the PHP scripting language, this is not covered here. Apache is the most commonly used Web services software, and MySQL is a relatively small database software, both software and PHP can be installed on the Windows machine.

PHP is in the form of a module and Apache into a whole, but Apache can not directly with MySQL, only through the PHP module to communicate with each other, this process is called dynamic request. For example, when the password is logged in the Web page, is a dynamic process, in the Apache Display page login entry password, and then through the PHP module to the MySQL data pair, the password is correct or wrong again through PHP feedback to Apache, and then displayed in the browser. In the static files, similar to the logo on the Web page pictures, Apache through the static file removal of images, etc., is not required by the MySQL data, can be displayed directly on the browser, so is a static request. MySQL can not save pictures, etc., stored in the user name password, points, text and other data.

2. MySQL and MariaDB Introduction

3. MySQL Installation

The MySQL installation package recommends binary-free compilation.
First download the installation package, go to the URL r.aminglinux.com find the latest MySQL binary installation package, binary package distinguish 32-bit system and 64-bit system, use the command uname-a can see the number of bits of the system, see,

Then use the command wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz to install, see,

After the download is complete, the first decompression, input command tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz, enter, decompression takes a certain amount of time, and the content is very much, this is not.

Then proceed to create user MySQL, see,

The last command error, showing the need to install Perl module, do not know the specific installation package, you need to first fuzzy search to install, or to the Web (Baidu, Google, Bing, etc.) on the search, see,

There are 4 search results, not sure exactly which one, all installed. This side know is the second, so directly installed up. Then enter the command again./scripts/mysql_install_db--user=mysql--datadir=/data/mysql, enter, see,



How do you know this execution is right? Method One, view the above contents of the two OK; method two, use the command echo $? (Query the previous command is correct), the result is 0. All indicate that the above implementation is not a problem.
The above initialization is complete, first to look at the configuration file, see,

Use command vi support-files/my-default.cnf, enter, see,

Exit, before you look at the file/etc/my.cnf, see,


That is, you can use this file without copying it, but you need to change the content. See

The contents of the red box are changed, save and exit. Then proceed to start the script, see,

Enter, and then do an edit on/etc/init.d/mysqld, see,

Change the contents of the red box, save and exit. Then proceed down,

The default permission for a file is 755, and if you want it to boot, add it to the list of system services. You can also use the command/etc/init.d/mysqld start and command service mysqld start, see,

Look at the process and the listening port, see,

There is another way to start, see,

This command line method, the command is longer. So this MySQL started up, how to close it? See

Command line start, no way to shut down, can only kill the process, this method is not used casually. But this way it's safer to use Killall, which stops the current read and write operations, and then writes the data that is not fully written to the disk in the cache and then kills the process after it's written.

The command line for the above operation is as follows:
Cd/usr/local/src
wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz Download the installation package
Tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz unpacking the installation package
MV Mysql-5.6.36-linux-glibc2.5-x86_64/usr/local/mysql
cd/usr/local/mysql/
Useradd MySQL
mkdir/data/
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
CP support-files/my-default.cnf/etc/my.cnf Copy configuration file
CP support-files/mysql.server/etc/init.d/mysqld Startup script
Vi/etc/init.d/mysqld (define Basedir and DataDir)
/etc/init.d/mysqld Start and service mysqld starting boot

Lamp architecture Introduction, MySQL and 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.