Linux系统:第十章:服务器环境搭建,西安java开发视频

Java HotSpot™ 64-Bit Server VM (build 25.152-b16, mixed mode)

查看:path路径:echo $PATH

/opt/jdk1.8.0_152/bin:/opt/jdk1.8.0_152/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

查看:JAVA_HOME路径:echo $JAVA_HOME

/opt/jdk1.8.0_152

Tomcat安装与配置

进入opt目录:cd /opt

在opt目录下上传apache-tomcat-8.5.24.tar.gz

解压: tar -zxvf apache-tomcat-8.5.24.tar.gz

启动tomcat: /opt/apache-tomcat-8.5.24/bin/startup.sh

如果报错进入logs目录查看:cd /opt/apache-tomcat-8.5.24/logs

查看日志:less catalina.out

MySQL的安装与配置

进入opt目录:cd /opt

在opt目录下上传MySQL-server-5.5.52-1.el6.x86_64.rpm和MySQL-client-5.5.52-1.el6.x86_64.rpm

忽略依赖关系执行删除:rpm -e --nodeps mariadb-libs-1:5.5.56-2.el7.x86_64

安装服务端:rpm -ivh /opt/MySQL-server-5.5.52-1.el6.x86_64.rpm

安装客户端:rpm -ivh /opt/MySQL-client-5.5.52-1.el6.x86_64.rpm

查看版本:mysqladmin --version

mysqladmin  Ver 8.42 Distrib 5.5.52, for Linux on x86_64

启动MySQL服务:systemctl start mysql.service

查看服务状态:systemctl status mysql.service

查看端口:netstat -anp|grep 3306

查看mysql运行的进程:ps -ef|grep mysql|grep -v grep

设置root用户和密码:mysqladmin -u root password

New password:

Confirm new password:

登录mysql:mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.5.52 MySQL Community Server (GPL)

Copyright © 2000, 2016, Oracle and/or its affiliates. All rig

《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义》

【docs.qq.com/doc/DSmxTbFJ1cmN1R2dB】 完整内容开源分享

hts 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;

使用test数据库:user test;

查看表:show tables;

退出:exit;

然后去windows的sqlYog连接,主机改为linux连接:192.168.134.100,用户名:root,密码:root

测试连接不上,linux中查看防火墙:systemctl status firewalld.service

● firewalld.service - firewalld - dynamic firewall daemon

Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)

Active: inactive (dead)

Docs: man:firewalld(1)

8月 12 07:32:47 rich systemd[1]: Starting firewalld - dynamic firewall daemon…

8月 12 07:32:47 rich systemd[1]: Started firewalld - dynamic firewall daemon.

8月 12 07:32:47 rich firewalld[721]: WARNING: ICMP type ‘beyond-scope’ is not supported by the kernel for ipv6.

8月 12 07:32:47 rich firewalld[721]: WARNING: beyond-scope: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time.

8月 12 07:32:47 rich firewalld[721]: WARNING: ICMP type ‘failed-policy’ is not supported by the kernel for ipv6.

8月 12 07:32:47 rich firewalld[721]: WARNING: failed-policy: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time.

8月 12 07:32:47 rich firewalld[721]: WARNING: ICMP type ‘reject-route’ is not supported by the kernel for ipv6.

8月 12 07:32:47 rich firewalld[721]: WARNING: reject-route: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time.

8月 12 09:30:57 rich systemd[1]: Stopping firewalld - dynamic firewall daemon…

8月 12 09:30:59 rich systemd[1]: Stopped firewalld - dynamic firewall daemon.

防火墙关了,没问题,应该是mysql授权问题

登录mysql:mysql -u root -p

查看数据库:show databases;

使用mysql数据库:user mysql;

查看表:show tables;

查看用户表:select host,user,password from user;

插入一条数据到用户表中(密码复制localhost的密码):insert into user(host,user,password) values(’%’,‘root’,‘81F5E21E35407D884A6CD4A731AEBFB6AF209E1B’);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值