Linux server environment to build

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

1 Code of Conduct
1.1 take a snapshot of
Linux operating system is very complex, all using the command to complete the installation process when setup the development environment. The 360 security guards did not like that kind of tool in the Linux system, we can not make a clean uninstall after an installation error. It is recommended that you perform each step in the installation process will take a snapshot to save the current state of the system, once installed a snapshot before the failure can be restored to start again.
1.2 before operating system files to back up
frequently necessary to modify the configuration file in a server environment during installation. The Linux environment configuration file at every turn hundreds of thousands of lines, but also need to be configured in multiple. Once you want to modify the error correction will be very difficult. So to develop a good habit: first make a backup before modifying the configuration file.
2 JDK, Tomcat installation
2.1 Overview of
these programs is actually not really "install", is only an environment variable can be configured directly after decompression.
2.2 extract the
tar -zxvf [archive file name]
2.3 configure the environment variables
at the end of the / etc / profile file is added following
the JAVA_HOME = / opt / jdk1.8.0_121
the PATH = / opt / jdk1.8.0_121 / bin: P A T H e x p O r t J A V A H O M E P A T H : PATH export JAVA_HOME PATH ":" it is a separator "between a plurality of values "usedto refer to an environment variable.": $ PATH "represents the original value of the PATH environment variable added to the system come in so as not to cover the value system we set the default value of
" export "represents publish a new configuration of environment variables
2.4 source command to validate the configuration above
source / etc / profile

3 MySQL on RPM
3.1 RPM instructions
RPM is the RedHat Package Manager acronym, the equivalent of Windows systems * .exe installer. Many applications provide RPM installation package.
3.2 RPM main command usage
uninstall the software rpm -e [package name]
to install the software rpm -ivh [package name]
during unloading ignore dependencies rpm -e --nodeps
ignore dependencies during installation rpm -ivh - nodeps
3.3 upload MySQL RPM package

rpm files to be uploaded to the "binary" form when uploading.
If you use a text upload, the upload process will be re-encoded, the program will not work.
Not unpack!
3.4 installation process
① take a snapshot
② uninstall Linux system already installed package will lead to a conflict of
RPM - nodeps -e MySQL-libs-5.1.73-7.el6.x86_64 (CentOS6)
RPM -e - nodeps MariaDB 1--libs: 5.5.56-2.el7.x86_64 (CentOS7)
※ Note: to uninstall this package is not the same in CentOS6 and CentOS7 in, depends on the specific conflict which one.
③ implementation of MySQL server installation program
RPM -ivh MySQL-Server-5.5.52-1.el6.x86_64.rpm
④ see MySQL server program creates system users and user groups
[root @ Love opt] # the above mentioned id MySQL
⑤ installation MySQL client
rpm -ivh MySQL-client-5.5.52-1.el6.x86_64.rpm

[root@love opt]# mysqladmin --version
mysqladmin Ver 8.42 Distrib 5.5.52, for Linux on x86_64
⑥启动MySQL服务
[root@love opt]# systemctl start mysql.service

[root@love opt]# netstat -anp|grep 3306
⑦调用mysqladmin程序给MySQL服务器设置root账号的密码
[root@love opt]# mysqladmin -u root password
New password:
Confirm new password:
⑧登录MySQL服务器
[root@love opt]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.52 MySQL Community Server (GPL)
Copyright © 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> show databases;

Supplement 1: Modify the MySQL server access
First step: @% authorized as root
MySQL> GRANT ALL PRIVILEGES ON . The TO 'root' @ '%' IDENTIFIED BY 'root' the WITH GRANT OPTION;
Query the OK, 0 rows affected (0.00 sec )

Note: follow the IDENTIFIED BY is behind the root account password.
Step two: Exit MySQL
MySQL Exit;
Bye
third step: restart the MySQL service
service mysql restart;
or
systemctl restart mysql.service

Supplement 2: Set the default character set of the MySQL server
first step: Copy the MySQL configuration file
cp /usr/share/mysql/my-small.cnf /etc/my.cnf
Step 2: Use vim editor to modify / etc / my. CNF
[mysqld]
Port = 3306
Socket = /var/lib/mysql/mysql.sock
Skip-External-locking
the key_buffer_size = 16K
the max_allowed_packet = 1M
table_open_cache. 4 =
sort_buffer_size = 64K
as read_buffer_size = 256K
of read_rnd_buffer_size = 256K
net_buffer_length The 2K =
thread_stack The 128K =
character- set-server = utf8
step: restart MySQL server
systemctl restart mysql.service
step Four: verify
MySQL> Show Variables like "%% char";
± ---------------- --------- ± --------------------------- +
| Variable_name | Value |
±-------------------------±---------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
±-------------------------±---------------------------+
8 rows in set (0.00 sec)

Create a database and verify database tables

Guess you like

Origin blog.csdn.net/No_mingzi/article/details/93708881