jdk,tomcat,mysql的安装

一、虚拟机的clone
1. clone的步骤

+   选择要clone虚拟机,右键--》管理--》clone对话框,点击打开
+  进入“欢迎使用clone虚拟机向导” 点击 下一步
+ clone 虚拟机当前状态或者从备份的快照中clone,然后点击“下一步“
+ 创建完整clone,点击”下一步”
+ 给clone出来的虚拟机命名,并指定存储空间即可,点击“完成”

2. clone之后eth0网卡不见的问题解决:

参考:<https://blog.csdn.net/Noodlewar/article/details/73797768>
二、查看后台服务的命令

​ service –status-all

​ chkconfig:查看服务启动级别

​ 可以通过vi /etc/inittab查看

[root@localhost apps]# vi /etc/inittab
结果如下:
Default runlevel. The runlevels used are:
0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)
id:3:initdefault:
[root@localhost ~]# chkconfig iptables --list
iptables        0:关闭    1:关闭    2:启用    3:启用    4:启用    5:启用    6:关闭
[root@localhost ~]# chkconfig iptables off
[root@localhost ~]# chkconfig iptables --list
iptables        0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭
[root@localhost ~]# chkconfig iptables on
[root@localhost ~]# chkconfig iptables --list
iptables        0:关闭    1:关闭    2:启用    3:启用    4:启用    5:启用    6:关闭
三、jdk的安装
  1. 安装jdk(wget,或者通过工具filezilla将windows的文件上传)

    • 可以使用儒兴华工具,filezilla
    • 可以使用sftp工具(SecureCRT工具 alt+t),
    • lrzsz 通过rz命令
  2. 解压jdk

    • 压缩命令

      [root@localhost software]# tar -cvf aaa.tar.gz jdk
    • 解压缩

      [root@localhost software]# tar -zxvf aaa.tar.gz
  3. 配置环境变量

    • 找到jdk的bin目录的路径
    [root@localhost bin]# pwd
    /root/apps/jdk-10/bin
    • vim /etc/profile

      export JAVA_HOME=/root/apps/jdk-10
      expott PATH=$PATH:$JAVA_HOME/bin
    • 重新加载文件

      [root@localhost bin]# source /etc/profile

四、mysql的安装(安装rpm包软件)
  1. 上传rpm安装包

    mysql-5.7.21-1.el6.x86_64.rpm-bundle.tar
    mysql-community-client-5.7.21-1.el6.x86_64.rpm
    mysql-community-common-5.7.21-1.el6.x86_64.rpm
    mysql-community-devel-5.7.21-1.el6.x86_64.rpm
    mysql-community-embedded-5.7.21-1.el6.x86_64.rpm
    mysql-community-embedded-devel-5.7.21-1.el6.x86_64.rpm
    mysql-community-libs-5.7.21-1.el6.x86_64.rpm
    mysql-community-libs-compat-5.7.21-1.el6.x86_64.rpm
    mysql-community-server-5.7.21-1.el6.x86_64.rpm
    mysql-community-test-5.7.21-1.el6.x86_64.rpm

    安装顺序

    rpm -ivh mysql-community-common-5.7.12-1.el6.x86_64.rpm   
    rpm -ivh mysql-community-libs-5.7.12-1.el6.x86_64.rpm   
    rpm -ivh mysql-community-client-5.7.12-1.el6.x86_64.rpm  
    rpm -ivh mysql-community-server-5.7.12-1.el6.x86_64.rpm  
    rpm -ivh mysql-community-devel-5.7.12-1.el6.x86_64.rpm  
  2. 安装perl依赖

    • rpm -ivh perl* (安装会提示有包冲突,解决: rpm -e 冲突包名 –nodeps)
  3. 安装common

    [root@localhost apps]# rpm -ivh mysql-community-common-5.7.21-1.el6.x86_64.rpm

    报错: 安装包冲突,之前安装的有mysql

    file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.21-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-8.el6_8.x86_64

    卸载已经安装的mysql

    [root@localhost apps]# yum -y remove mysql-libs-5.1.73-8.el6_8.x86_64

    再次安装common,即可!

  4. 安装libs

    [root@localhost apps]# rpm -ivh mysql-community-libs-5.7.21-1.el6.x86_64.rpm
    warning: mysql-community-libs-5.7.21-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
      1:mysql-community-libs   ########################################### [100%]
  5. 安装client

    [root@localhost apps]# rpm -ivh mysql-community-client-5.7.21-1.el6.x86_64.rpm
    warning: mysql-community-client-5.7.21-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
      1:mysql-community-client ########################################### [100%]
  6. 安装server

    [root@localhost apps]# rpm -ivh mysql-community-server-5.7.21-1.el6.x86_64.rpm
    warning: mysql-community-server-5.7.21-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
      1:mysql-community-server ########################################### [100%]
    

shell
[root@localhost apps]# rpm -ivh mysql-community-server-5.7.21-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.21-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.21-1.el6.x86_64
libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.21-1.el6.x86_64
libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.21-1.el6.x86_64
mysql-community-client(x86-64) >= 5.7.9 is needed by mysql-community-server-5.7.21-1.el6.x86_64
mysql-community-common(x86-64) = 5.7.21-1.el6 is needed by mysql-community-server-5.7.21-1.el6.x86_64

安装出现了问题:

libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.21-1.el6.x86_64

缺少依赖包,通过yum安装即可

shell
[root@localhost apps]# yum install libnuma*


  1. 安装devel

    [root@localhost apps]# rpm -ivh mysql-community-devel-5.7.21-1.el6.x86_64.rpm 
    warning: mysql-community-devel-5.7.21-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
      1:mysql-community-devel  ########################################### [100%]
  2. 启动mysql服务

    [root@localhost apps]# service mysqld start
    初始化 MySQL 数据库:                                      [确定]
    正在启动 mysqld[确定]
  3. 修改管理员密码

    查看初始管理员密码,下面的命令适用于 RHEL, Oracle Linux, CentOS, and Fedora 平台:

    [root@localhost apps]# grep 'temporary password' /var/log/mysqld.log
    2018-03-28T15:13:47.745123Z 1 [Note] A temporary password is generated for root@localhost: ?cpDoUgi;7c!

    登陆成功(参考第10步)后修改密码:

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123';
    ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

    密码太简单,报错:Your password does not satisfy the current policy requirements

    密码必须包含大写字母小写字母数字和符号

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';  
    Query OK, 0 rows affected (0.00 sec)
  4. 测试数据库是否安装成功

    [root@localhost apps]# mysql -uroot -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 3
    Server version: 5.7.21
    
    Copyright (c) 2000, 2018, 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.

  5. mysql禁止远程登陆访问,如何解决?

    报错:1130-host … is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost

    • 该表法(亲测有效)

      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> update user set host='%' where user = 'root';
      Query OK, 1 row affected (0.00 sec)
      Rows matched: 1  Changed: 1  Warnings: 0
      mysql> select host,user from user;
      +-----------+---------------+
      | host      | user          |
      +-----------+---------------+
      | %         | root          |
      | localhost | mysql.session |
      | localhost | mysql.sys     |
      +-----------+---------------+
      3 rows in set (0.00 sec)
      • 授权法(没有测试)

      参考: https://blog.csdn.net/piaocoder/article/details/53704126

      2. 授权法。
      
      例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
      
      GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
      
      FLUSH   PRIVILEGES;
      
      如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码
      
      GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
      
      FLUSH   PRIVILEGES;
      
      如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器的dk数据库,并使用mypassword作为密码
      
      GRANT ALL PRIVILEGES ON dk.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
      
      FLUSH   PRIVILEGES;
      
      我用的第一个方法,刚开始发现不行,在网上查了一下,少执行一个语句 mysql>FLUSH RIVILEGES 使修改生效.就可以了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值