Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build lnmp Development Environment in centos7

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Centos7 how to build lnmp development environment, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Nginx installation

1. Add source

Sudo rpm-Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2. Install Nginx

Sudo yum install-y nginx

3. Start Nginx and set the boot to run automatically.

Sudo systemctl start nginx.servicesudo systemctl enable nginx.serviceMySql installation

1. Check the linux operating system version and system kernel version

# cat / etc/redhat-release View operating system version

# uname-r View the kernel version of the system

2. Download the corresponding version of MySQL installation file

1. Download address; https://dev.mysql.com/downloads/mysql/

2. Select the corresponding Linux version and x86/x64 to download

You can choose RPM Bundle. After downloading, remember to decompress tar-xvf xxx.tar.

Wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar

You can also refine the download, download the required mysql components, there are four: server, client, common, libs

3. Uninstall the old version of MySql

(1) View the old version of MySql

Rpm-qa | grep mysql

(2) delete the old components one by one

Use the command rpm-e {- file-name} to remove. There may be dependencies when removing. You should delete it from back to front.

4. Use the rpm command to install MySql components

Use the command rpm-ivh {- file-name} to install.

Install RPM package dependencies according to dependencies: common → libs → client → server

Rpm-ivh mysql-community-common-5.7.22-1.el7.x86_64.rpm

Rpm-ivh mysql-community-libs-5.7.22-1.el7.x86_64.rpm

Rpm-ivh mysql-community-client-5.7.22-1.el7.x86_64.rpm

Rpm-ivh mysql-community-server-5.7.22-1.el7.x86_64.rpm

Generate the directory when you are finished:

a)。 Generate my.cnf files and my.cnf.d folders under / etc/

b)。 Produce the following three folders under / var/lib/: mysql,mysql-files,mysql-keyring

c)。 Generate mysqld.log file under / var/log/

d)。 Generate the mysqld directory under / var/run/

5. Start the MySQL service

Service mysqld start

6. Boot up

# systemctl enable mysqld

# systemctl daemon-reload

7. Modify the root local login password

1) View mysql password

# grep 'temporary password' / var/log/mysqld.log

2) Connect to mysql

# mysql-uroot-p

3) change the password [Note: the semicolon must follow]

# ALTER USER 'root'@'localhost' IDENTIFIED BY' MyNewPass4passport'

Or:

# set password for 'root'@'localhost'=password (' MyNewPass4passport')

# show variables like'% password%'

4) add Telnet user

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'username'@'%' IDENTIFIED BY' password' WITH GRANT OPTION

After reading the above, have you mastered how to build a lnmp development environment in centos7? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report