You are advised to save the installation software to the /usr/local directory

Tomcat

  • First of all, start from the simplest Tomcat, enter the Apache official website: www.apache.org, download the appropriate version to install, generally recommended 8.0 or more versions. Please refer to my article: blog.csdn.net/qq_41684621… , download it to the local PC and then upload it to the server. You can also download it directly from the server using the address wGET + instead of downloading it to the local PC. After decompression, go to the bin directory and run the following commands:
./start.sh  / / start
./shutdown.sh / / stop
Copy the code

JDK

  • The installation of the JDK is familiar with, download will not say more, version or choose 1.8. For configuration of the post-installation environment, please refer to my article: blog.csdn.net/qq_41684621…

Nginx

Install some dependencies before installing

yum -y install gcc gcc-c++
wget http:/ / nginx.org/download/nginx-1.10.1.tar.gz
yum  -y install pcre-devel openssl-devel
Copy the code

After installation, switch to the directory where nginx decompressed and execute:

./configure --prefix=/usr/local/nginx
yum -y install gcc gcc-c++ autoconf automake make    // Install c compiler
make && make install
Copy the code

Common commands:

./nginx			/ / start
./nginx -s stop	/ / stop
./nginx -s reload	// Overload configuration
Copy the code

MySQL

Download the mysql repo source

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 
Copy the code

Install mysql – community – release – el7-5. Noarch. RPM package

rpm -ivh mysql-community-release-el7-5.noarch.rpm
Copy the code

Look at the

ls -1 /etc/yum.repos.d/mysql-community*
/etc/yum.repos.d/mysql-community.repo
/etc/yum.repos.d/mysql-community-source.repo
Copy the code

Repo: /etc/yum. Repos. D /mysql-community. Repo: /etc/yum.

Mysql installation

yum install mysql-server
Copy the code

Log in and change the password Use the default password to log in

mysql -uroot -p
Copy the code

ERROR 2002 (HY000): Can “t connect to local MySQL server through socket ‘/ var/lib/MySQL/MySQL. The sock’ (2), the reason is that the/var/lib/MySQL access problems. Mysql > change the owner of /var/lib/mysql to the current user:

chown -R openscanner:openscanner /var/lib/mysql
Copy the code

If chown: is invalid user :openscanner :openscanner error is reported, change the command, and use ll to view the directory permission list

chown root /var/lib/mysql/
ll
Copy the code

The attached: ① Change the file owner (chown) [root@linux ~]# chown account name File or directory ② Change the user group of the file by running the command CHGRP [root@linux ~]# CHGRP group name File or directory ③ Change the directory permission. By default, only the current level is changed. If the subdirectory is also recursive, you need to add R parameter Chown -r: to recurse, along with all files and directories in the subdirectory

Then, restart the service:

systemctl mysqld restart
Copy the code

Next login to reset password:

mysql -u root -p
mysql > use mysql;
mysql > update user set password = 'New password' where user='root';
mysql > exit;
Copy the code

If you cannot log in to the mysql server, perform the following operations: Start the mysql server and check its running status.

systemctl start mysqld		// Start the mysql service
service mysqld status	// Check the status of mysql
Copy the code

Method one:

grep 'temporary password' /var/log/mysqld.log
Copy the code

After running it, I get a temporary password. In this case, my Centos7.3 does not respond, so I try the second method

Method 2:

1. MySQL > alter table logon;

 vim /etc/my.cnf
Copy the code

Add a sentence to the [mysqld] paragraph:

skip-grant-tables
Copy the code

2. Restart mysql

systemctl mysql restart
Copy the code

3. MySQL > alter user root password

 mysql> use mysql; 
 Database changed 
 mysql> update user set password = 'New password' where user = 'root'; 
 Query OK, 0 rows affected (0.00 sec) 
 Rows matched: 5 Changed: 0 Warnings: 0 
 mysql> flush privileges; 
 Query OK, 0 rows affected (0.01 sec) 
 mysql> quit
Copy the code

4. Change MySQL login Settings to no password

vim /etc/my.cnf
Copy the code

Comment out skip-grant-tables in [mysqld]

# skip-grant-tables
Copy the code

Save and exit vim 5. Restart mysql

sytemctl mysql restart
Copy the code

If the password is set, the user does not need to log in to the mysql server again. In this case, the user needs to restart the server:

reboot
Copy the code

If you need to remotely log in to mysql on a local Navicat server, you can refer to my article: blog.csdn.net/qq_41684621…