In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces an overview of LAMP and MySQL installation tutorials, the things involved, learned from the theoretical knowledge, there are many books, literature for your reference, from a practical point of view, accumulated years of practical experience can be shared with you.
Introduction to LAMP
LAMP=Linux+Apache (httpd) + MySQL+PHP
Apache and httpd complement each other and must be together.
Apache+MySQL+PHP can be installed on the same machine at the same time
MySQL installation
Source file: http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
Module support installation package: perl-Data-Dumper.x86_64
Download the MySQL installation package [root@shu-test ~] # cd / usr/local/src/ [root@shu-test src] # lshttpd-2.2.34 httpd-2.2.34.tar.gz [root@shu-test src] # wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz and move the name to the installation path [root@shu-test src] # Tar zxvf mysql-5.6.36-linux-glibc2.5-x86_ 64.tar.gz [root @ shu-test src] # mv mysql-5.6.36-linux-glibc2.5-x86_64 / usr/local/mysql [root@shu-test src] # ls / usr/local/apache2 bin etc games include lib lib64 libexec mysql sbin share src [root@shu-test src] # ls / usr/local/mysql/bin COPYING data docs include lib man mysql-test README scripts share sql-bench support-files [root@shu-test src] #
Note: the mysql in / usr/local/mysql should not be created in advance, it can only be moved without this folder; otherwise, under the / mysql folder is the / mysql-5.6.36-linux-glibc2.5-x86_64 folder.
Create a mysql user
Create a new mysql user to facilitate subsequent calls to the mysql database
Useradd mysql create / data directory [root@shu-test src] # cd / usr/local/mysql/ [root@shu-test mysql] # lsbin COPYING data docs include lib man mysql-test README scripts share sql-bench support-files [root@shu-test mysql] # [root@shu-test mysql] # mkdir / data/ [root@shu-test mysql] # lsbin COPYING data docs include lib man mysql-test README scripts share sql-bench support-files [root@shu-test mysql] # installation database specifies the directory and user name of the mysql database Error prompt handling
. / scripts/mysql_install_db-user=mysql-datadir=/data/mysql
Specify the user name of mysql as mysql and the database directory as the / data/mysql directory you just created
[root@shu-test mysql] # / scripts/mysql_install_db-- user=mysql-- datadir=/data/mysqlFATAL ERROR: please install the following Perl modules before executing. / scripts/mysql_install_db:Data:: Dumper [root @ shu-test mysql] #
The Dumper module is missing at this point
Find the dumper module package
Yum list | grep perl | grep-I dumper
List dumper packages that contain perl modules and are case-insensitive
[root@shu-test mysql] # yum list | grep perl | grep-I dumperperl-Data-Dumper.x86_64 2.145-3.el7 base perl-XML-Dumper.noarch 0.81-17.el7 base [root@shu-test mysql] # installation module support package yum install-y perl-Data-Dumper.x86_64 continues to execute the specified directory and user name with echo $? Check whether the command is successful [root@shu-test mysql] # / scripts/mysql_install_db-- user=mysql-- datadir=/data/mysql [root@shu-test mysql] # echo $? 0 [root@shu-test mysql] # copy the configuration template to etc (default) [root@shu-test mysql] # cp support-files/my-default.cnf / etc/my.cnfcp: whether to overwrite "/ etc/my.cnf"? N [root@shu-test mysql] # ls / etc/my.cnf/etc/my.cnf [root@shu-test mysql] # modify / etc/my.cnf configuration file [root@shu-test mysql] # vim / etc/my.cnf [root@shu-test mysql] # cat / 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 [root@shu-test mysql] #
Modify datadir and socket, and comment out others
Set up boot boot
Cp support-files/mysql.server / etc/init.d/mysqld
Vim / etc/init.d/mysqld
1 specify the directory
Basedir=/usr/local/mysql
Datadir=/data/mysql
2 add boot startup item mysql
Chkconfig-add mysqld
3 View boot items
Chkconfig-list
If you see mysql service, 345 are all on, then it is successful.
Specify 345 start command
Chkconfig-level 345 mysql on
Starts when shutting down the mysql service
Enable the mysqld service
Service mysqld start
Query whether mysql is started
Ps aux | grep mysqld
Query the port where the service is started
Netstat-lntp
Turn off the mysql service
Killall mysqld
Read the above LAMP overview and MySQL installation tutorial introduction, hoping to give you some help in practical application. Due to the limited space in this article, there will inevitably be deficiencies and areas that need to be supplemented. You can continue to pay attention to the industry information section and will update your industry news and knowledge regularly. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.