java linux解压_linux整套java环境解压版

本文档详细介绍了如何在Linux环境下安装Java、Tomcat和MySQL。首先,通过链接提供了JDK的安装教程。接着,给出了Tomcat的部署指南。然后,重点讲述了MySQL的下载、解压、用户创建、配置文件安装、初始化和启动过程。最后,提到了使用Navicat进行连接以及检查防火墙设置的注意事项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

---恢复内容开始---

1、jdk

https://blog.youkuaiyun.com/chadeltu/article/details/46503945

2、tomcat

https://www.cnblogs.com/FancyLian/p/7136135.html

3、mysql

自己总结:

查看状态、重启、关闭

ps -ef|grep mysql;service mysql restart;service mysql stop;

直接看下面的步骤就行,安装包在百度云里面有使用5.7-2.5那个比较没出现问题。

下载

https://dev.mysql.com/downloads/mysql/

c78b6db9c6ed0d072af772586e3200e2.png

下载:

5.7.11:

http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz

5.7.21:

https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz

安装详细看(亲测可行):https://blog.youkuaiyun.com/yangdili/article/details/78834307

1、下载略

2.解压文件,复制到/usr/local

tar -xvf mysql-5.7.20-linux-glibc2.12-x86_64.tar     解压后有有两个文件:mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz,mysql-test-5.7.20-linux-glibc2.12-x86_64.tar.gz

tar -xzvf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz 解压后文件名为:mysql-5.7.20-linux-glibc2.12-x86_64,

mv mysql-5.7.20-linux-glibc2.12-x86_64 mysql  重命名

cp mysql /usr/local/ -r  复制

cd /usr/local 进入安装文件夹

3. 增加用户

[root@localhost mysql]# groupadd mysql

[root@localhost mysql]# useradd -r -g mysql mysql

[root@localhost mysql]# cd ..

[root@localhost local]# chown -R mysql mysql/

[root@localhost local]#  chgrp -R mysql mysql/

[root@localhost local]# cd mysql/

[root@localhost mysql]# bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/

2017-12-18 15:38:29 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

2017-12-18 15:38:31 [WARNING] The bootstrap log isn't empty:

2017-12-18 15:38:31 [WARNING] 2017-12-18T07:38:29.824248Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

2017-12-18T07:38:29.835981Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)

2017-12-18T07:38:29.836022Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)

4.安装

[root@localhost mysql]# cp -a ./support-files/mysql.server  /etc/init.d/mysqld

[root@localhost mysql]# cp -a ./support-files/my-default.cnf /etc/my.cnf

cp: 无法获取"./support-files/my-default.cnf" 的文件状态(stat): 没有那个文件或目录

当报这个错误的时候增加一个my-default.cnf 文件。内容配置如下:

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the

# *** default location during install, and will be replaced if you

# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging

# changes to the binary log between backups.

# log_bin

# These are commonly set, remove the # and set as required.

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data

# port = .....

# server_id = .....

# socket = .....

# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

然后在执行:

[root@localhost mysql]# cp -a ./support-files/my-default.cnf /etc/my.cnf

cp:是否覆盖"/etc/my.cnf"? y

[root@localhost mysql]# ll

[root@localhost mysql]# cd bin

[root@localhost bin]# ./mysqld_safe --user=mysql &

[1] 8475

[root@localhost bin]# Logging to '/usr/local/mysql/data/localhost.localdomain.err'.

2017-12-18T07:47:16.901751Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]# /etc/init.d/mysqld restart

Shutting down MySQL..2017-12-18T07:47:43.297782Z mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended

SUCCESS!

Starting MySQL. SUCCESS!

[1]+  完成                  ./mysqld_safe --user=mysql

5.初始化密码,以及添加远程访问

[root@localhost bin]# cat /root/.mysql_secret

# Password set for user 'root@localhost' at 2017-12-18 15:38:29

(Af_i4,i(.E;

[root@localhost bin]# ./mysql -uroot -p

Enter password:

mysql> select version();

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

mysql> SET PASSWORD = PASSWORD('yangdi');

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> select version();

+-----------+

| version() |

+-----------+

| 5.7.20    |

+-----------+

1 row in set (0.00 sec)

mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select host, user from user;

+-----------+---------------+

| host      | user          |

+-----------+---------------+

| localhost | mysql.session |

| localhost | mysql.sys     |

| localhost | root          |

+-----------+---------------+

3 rows in set (0.00 sec)

mysql>  update user set host = '%' where user = 'root';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0

mysql>quit;

[root@localhost bin]# /etc/init.d/mysqld restart

Shutting down MySQL.. SUCCESS!

Starting MySQL. SUCCESS!

[root@localhost bin]# ps -ef |grep mysql

设置开机启动

[root@localhost bin]#chkconfig --level

35

mysqld on

6.使用navicate 连接,检查防火墙状态!!!!

(下面遇到的问题可不看)

安装:5.6与5.7的安装命令不同,5.7不再使用mysql而是使用mysqld

https://www.cnblogs.com/JavaCoffee/p/5587578.html

安装:

https://blog.youkuaiyun.com/lppklm/article/details/50977775

问题:

root@bigdata-159:/usr/local/mysql# ./bin/mysqld -- defaults-file=/etc/my.cnf --initialize --user=mysql

./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

解决方法:

[root@example.com data]# yum install -y libaio  //安装后在初始化就OK了

4、redis

比较完整安装

https://blog.youkuaiyun.com/lc1010078424/article/details/78295482

---恢复内容结束---

1、jdk

https://blog.youkuaiyun.com/chadeltu/article/details/46503945

2、tomcat

https://www.cnblogs.com/FancyLian/p/7136135.html

3、mysql

下载

https://dev.mysql.com/downloads/mysql/

c78b6db9c6ed0d072af772586e3200e2.png

下载:

5.7.11:

http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz

5.7.21:

https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz

安装详细看(亲测可行):https://blog.youkuaiyun.com/yangdili/article/details/78834307

1、下载略

2.解压文件,复制到/usr/local

tar -xvf mysql-5.7.20-linux-glibc2.12-x86_64.tar     解压后有有两个文件:mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz,mysql-test-5.7.20-linux-glibc2.12-x86_64.tar.gz

tar -xzvf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz 解压后文件名为:mysql-5.7.20-linux-glibc2.12-x86_64,

mv mysql-5.7.20-linux-glibc2.12-x86_64 mysql  重命名

cp mysql /usr/local/ -r  复制

cd /usr/local 进入安装文件夹

3. 增加用户

[root@localhost mysql]# groupadd mysql

[root@localhost mysql]# useradd -r -g mysql mysql

[root@localhost mysql]# cd ..

[root@localhost local]# chown -R mysql mysql/

[root@localhost local]#  chgrp -R mysql mysql/

[root@localhost local]# cd mysql/

[root@localhost mysql]# bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/

2017-12-18 15:38:29 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

2017-12-18 15:38:31 [WARNING] The bootstrap log isn't empty:

2017-12-18 15:38:31 [WARNING] 2017-12-18T07:38:29.824248Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

2017-12-18T07:38:29.835981Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)

2017-12-18T07:38:29.836022Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)

4.安装

[root@localhost mysql]# cp -a ./support-files/mysql.server  /etc/init.d/mysqld

[root@localhost mysql]# cp -a ./support-files/my-default.cnf /etc/my.cnf

cp: 无法获取"./support-files/my-default.cnf" 的文件状态(stat): 没有那个文件或目录

当报这个错误的时候增加一个my-default.cnf 文件。内容配置如下:

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the

# *** default location during install, and will be replaced if you

# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging

# changes to the binary log between backups.

# log_bin

# These are commonly set, remove the # and set as required.

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data

# port = .....

# server_id = .....

# socket = .....

# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

然后在执行:

[root@localhost mysql]# cp -a ./support-files/my-default.cnf /etc/my.cnf

cp:是否覆盖"/etc/my.cnf"? y

[root@localhost mysql]# ll

[root@localhost mysql]# cd bin

[root@localhost bin]# ./mysqld_safe --user=mysql &

[1] 8475

[root@localhost bin]# Logging to '/usr/local/mysql/data/localhost.localdomain.err'.

2017-12-18T07:47:16.901751Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]# /etc/init.d/mysqld restart

Shutting down MySQL..2017-12-18T07:47:43.297782Z mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended

SUCCESS!

Starting MySQL. SUCCESS!

[1]+  完成                  ./mysqld_safe --user=mysql

5.初始化密码,以及添加远程访问

[root@localhost bin]# cat /root/.mysql_secret

# Password set for user 'root@localhost' at 2017-12-18 15:38:29

(Af_i4,i(.E;

[root@localhost bin]# ./mysql -uroot -p

Enter password:

mysql> select version();

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

mysql> SET PASSWORD = PASSWORD('yangdi');

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> select version();

+-----------+

| version() |

+-----------+

| 5.7.20    |

+-----------+

1 row in set (0.00 sec)

mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select host, user from user;

+-----------+---------------+

| host      | user          |

+-----------+---------------+

| localhost | mysql.session |

| localhost | mysql.sys     |

| localhost | root          |

+-----------+---------------+

3 rows in set (0.00 sec)

mysql>  update user set host = '%' where user = 'root';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0

mysql>quit;

[root@localhost bin]# /etc/init.d/mysqld restart

Shutting down MySQL.. SUCCESS!

Starting MySQL. SUCCESS!

[root@localhost bin]# ps -ef |grep mysql

设置开机启动

[root@localhost bin]#chkconfig --level

35

mysqld on

6.使用navicate 连接,检查防火墙状态!!!!

(下面遇到的问题可不看)

安装:5.6与5.7的安装命令不同,5.7不再使用mysql而是使用mysqld

https://www.cnblogs.com/JavaCoffee/p/5587578.html

安装:

https://blog.youkuaiyun.com/lppklm/article/details/50977775

问题:

root@bigdata-159:/usr/local/mysql# ./bin/mysqld -- defaults-file=/etc/my.cnf --initialize --user=mysql

./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

解决方法:

[root@example.com data]# yum install -y libaio  //安装后在初始化就OK了

4、redis

比较完整安装

https://blog.youkuaiyun.com/lc1010078424/article/details/78295482

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值