Centos7 install mysql Redis

Novice bloggers record notes on centos7

To install mysql, redis.

Aliyun sudo vi /etc/hostname change the hostname set the password upload the Java compressed package set the user

# add username haiming # add passwd ***Copy the code

Setting permission sudo vi /etc/sudoers

admin ALL=(ALL)  NOPASSWD:ALL
Copy the code

Redis installation

# yum install GCC - C + + because wget redis is written by C # # http://download.redis.io/releases/redis-5.0.4.tar.gz tar ZXVF. - Redis-5.0.4.tar. gz # redis-5.0.4 /usr/local # redis-5.0.4 /usr/local # redis-5.0.4 /usr/local # redis-5.0.4 /usr/local # redis-5.0.4 /usr/local # redis-5.0.4.  Conf /usr/local/redis /etc// cp the configuration file to etc CD SRC // cp the configuration file to bin cp mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server /usr/local/redis/bin/ vi / usr/local/redis/etc/redis. Conf comments # bind 127.0.0.1 protect -?? 1. Go to the current redis client # redis-cli 2. Modify the configuration file using the client: #config set protected-mode "no" config set stop-writes-on-bgsave-error no Start service CD #config set protected-mode "no" config set stop-writes-on-bgsave-error no Start service CD / usr/local/redis/bin to specify the configuration file Start the service port # 127.0.0.1 cancellation CD/usr/local/redis/bin #. / redis server/usr/local/redis/etc/redis. Conf CD /usr/local/redis/bin #./redis-cli // Start the clientCopy the code

See if start-up success: ps aux | grep redis startup process service redis start 1. Close the redis process. / bin/redis - cli shutdown 2. Kill 9 pid processCopy the code

Mysql 5.7 installation

$ wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm $ rpm -ivh Mysql > install mysql57-community-release-el7-8.noarch. RPM $yum -y install mysql57-community-release-el7-8.noarch. RPM $yum -y install mysql57-community-release-el7-8.noarch. The/var/log/var/log/mysqld log service startup scripts: / usr/lib/systemd/system/mysqld. Service socket file: The/var/run/mysqld/mysqld. Pid service mysqld start starts the service mysqld restart restart Change password: Log // Check the random password mysql -u root -p // Enter the random password and choose > ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'. // Insert password Account root Password 123456 > > Flush PRIVILEGES; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; CNF [mysqld] character_set_server=utf8 init_connect='SET NAMES utf8' #vim /etc/my.cnf [mysqld] character_set_server=utf8 init_connect='SET NAMES utf8' [root@localhost ~]# sudo service mysqld start mysql -u root -p mysql> show variables like '%character%'; / / check coding systemctl status mysqld. Service / / view state ps - ef | grep mysqlCopy the code

Ali Cloud run JAR package

Nohup Java jar — — — — — -. The jar & / / the background jars ps – ef | grep kill 9 Java check process, rewrite the deployment / / kill process