在阿里云的CentOS环境中安装配置MySQL、JDK、Maven
Welcome to Alibaba Cloud Elastic Compute Service ! [root@izbp19stm1x1k2io1e7r3tz ~]# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
Preparing... ################################# [%]
Updating / installing...
:mysql-community-release-el7- ################################# [%]
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community
mysql-tools-community/x86_64 MySQL Tools Community
mysql56-community/x86_64 MySQL 5.6 Community Server
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]# yum -y install mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 :5.6.-.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-) = 5.6.-.el7 for package: mysql-community-server-5.6.-.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-) >= 5.6. for package: mysql-community-server-5.6.-.el7.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: mysql-community-server-5.6.-.el7.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.-.el7.x86_64
--> Processing Dependency: libaio.so.(LIBAIO_0.)(64bit) for package: mysql-community-server-5.6.-.el7.x86_64
--> Processing Dependency: libaio.so.(LIBAIO_0.)(64bit) for package: mysql-community-server-5.6.-.el7.x86_64
--> Processing Dependency: libaio.so.()(64bit) for package: mysql-community-server-5.6.-.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 :0.3.-.el7 will be installed
---> Package mysql-community-client.x86_64 :5.6.-.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-) >= 5.6. for package: mysql-community-client-5.6.-.el7.x86_64
---> Package mysql-community-common.x86_64 :5.6.-.el7 will be installed
---> Package perl-DBI.x86_64 :1.627-.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-.el7.x86_64
---> Package perl-Data-Dumper.x86_64 :2.145-.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 :5.5.-.el7 will be obsoleted
---> Package mysql-community-libs.x86_64 :5.6.-.el7 will be obsoleting
---> Package perl-PlRPC.noarch :0.2020-.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch :2.061-.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-.el7.noarch
---> Package perl-Net-Daemon.noarch :0.48-.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 :2.061-.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 :2.061-.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ===========================================================================================================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================================================================================================
Installing:
mysql-community-libs x86_64 5.6.-.el7 mysql56-community 2.0 M
replacing mariadb-libs.x86_64 :5.5.-.el7
mysql-community-server x86_64 5.6.-.el7 mysql56-community M
Installing for dependencies:
libaio x86_64 0.3.-.el7 base k
mysql-community-client x86_64 5.6.-.el7 mysql56-community M
mysql-community-common x86_64 5.6.-.el7 mysql56-community k
perl-Compress-Raw-Bzip2 x86_64 2.061-.el7 base k
perl-Compress-Raw-Zlib x86_64 :2.061-.el7 base k
perl-DBI x86_64 1.627-.el7 base k
perl-Data-Dumper x86_64 2.145-.el7 base k
perl-IO-Compress noarch 2.061-.el7 base k
perl-Net-Daemon noarch 0.48-.el7 base k
perl-PlRPC noarch 0.2020-.el7 base k Transaction Summary
===========================================================================================================================================================================================================================================
Install Packages (+ Dependent packages) Total download size: M
Downloading packages:
(/): libaio-0.3.-.el7.x86_64.rpm | kB ::
warning: /var/cache/yum/x86_64//mysql56-community/packages/mysql-community-common-5.6.-.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.6.-.el7.x86_64.rpm is not installed
(/): mysql-community-common-5.6.-.el7.x86_64.rpm | kB ::
(/): mysql-community-libs-5.6.-.el7.x86_64.rpm | 2.0 MB ::
(/): perl-Compress-Raw-Bzip2-2.061-.el7.x86_64.rpm | kB ::
(/): perl-DBI-1.627-.el7.x86_64.rpm | kB ::
(/): perl-Compress-Raw-Zlib-2.061-.el7.x86_64.rpm | kB ::
(/): perl-Data-Dumper-2.145-.el7.x86_64.rpm | kB ::
(/): perl-Net-Daemon-0.48-.el7.noarch.rpm | kB ::
(/): perl-PlRPC-0.2020-.el7.noarch.rpm | kB ::
(/): perl-IO-Compress-2.061-.el7.noarch.rpm | kB ::
(/): mysql-community-client-5.6.-.el7.x86_64.rpm | MB ::
(/): mysql-community-server-5.6.-.el7.x86_64.rpm | MB ::
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 9.2 MB/s | MB ::
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: a4a9 76fc bd3c 70c8 8c71 8d3b e1f5
Package : mysql-community-release-el7-.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : perl-Data-Dumper-2.145-.el7.x86_64 /
Installing : mysql-community-common-5.6.-.el7.x86_64 /
Installing : mysql-community-libs-5.6.-.el7.x86_64 /
Installing : mysql-community-client-5.6.-.el7.x86_64 /
Installing : libaio-0.3.-.el7.x86_64 /
Installing : :perl-Compress-Raw-Zlib-2.061-.el7.x86_64 /
Installing : perl-Net-Daemon-0.48-.el7.noarch /
Installing : perl-Compress-Raw-Bzip2-2.061-.el7.x86_64 /
Installing : perl-IO-Compress-2.061-.el7.noarch /
Installing : perl-PlRPC-0.2020-.el7.noarch /
Installing : perl-DBI-1.627-.el7.x86_64 /
Installing : mysql-community-server-5.6.-.el7.x86_64 /
Erasing : :mariadb-libs-5.5.-.el7.x86_64 /
Verifying : mysql-community-server-5.6.-.el7.x86_64 /
Verifying : perl-Compress-Raw-Bzip2-2.061-.el7.x86_64 /
Verifying : perl-Net-Daemon-0.48-.el7.noarch /
Verifying : mysql-community-common-5.6.-.el7.x86_64 /
Verifying : perl-Data-Dumper-2.145-.el7.x86_64 /
Verifying : mysql-community-libs-5.6.-.el7.x86_64 /
Verifying : perl-PlRPC-0.2020-.el7.noarch /
Verifying : :perl-Compress-Raw-Zlib-2.061-.el7.x86_64 /
Verifying : perl-DBI-1.627-.el7.x86_64 /
Verifying : libaio-0.3.-.el7.x86_64 /
Verifying : mysql-community-client-5.6.-.el7.x86_64 /
Verifying : perl-IO-Compress-2.061-.el7.noarch /
Verifying : :mariadb-libs-5.5.-.el7.x86_64 / Installed:
mysql-community-libs.x86_64 :5.6.-.el7 mysql-community-server.x86_64 :5.6.-.el7 Dependency Installed:
libaio.x86_64 :0.3.-.el7 mysql-community-client.x86_64 :5.6.-.el7 mysql-community-common.x86_64 :5.6.-.el7 perl-Compress-Raw-Bzip2.x86_64 :2.061-.el7 perl-Compress-Raw-Zlib.x86_64 :2.061-.el7
perl-DBI.x86_64 :1.627-.el7 perl-Data-Dumper.x86_64 :2.145-.el7 perl-IO-Compress.noarch :2.061-.el7 perl-Net-Daemon.noarch :0.48-.el7 perl-PlRPC.noarch :0.2020-.el7 Replaced:
mariadb-libs.x86_64 :5.5.-.el7 Complete!
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]# systemctl enable mysqld
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]# systemctl start mysqld
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here. Enter current password for root (enter for none):
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation. Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success! By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment. Remove anonymous users? [Y/n] Y
... Success! Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y
... Success! By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment. Remove test database and access to it? [Y/n] n
... skipping. Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] Y
... Success! All done! If you've completed all of the above steps, your MySQL
installation should now be secure. Thanks for using MySQL! Cleaning up...
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]#
[root@izbp19stm1x1k2io1e7r3tz ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. MySQL Community Server (GPL) Copyright (c) , , 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 tables;
ERROR (3D000): No database selected
mysql> show dababases;
ERROR (): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dababases' at line
mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
rows 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> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| innodb_index_stats |
| innodb_table_stats |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slave_master_info |
| slave_relay_log_info |
| slave_worker_info |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
rows in set (0.00 sec) mysql>
mysql>
mysql>
https://yq.aliyun.com/ziliao/132362
https://www.cnblogs.com/thinkingandworkinghard/p/6711255.html
1.下载安装文件
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
2.解压安装(当前目录为/opt/build):
tar -zxvf apache-maven-3.3.-bin.tar.gz
配置环境变量
使用vim编辑/etc/profile文件
命令:vim /etc/profile(提示:vim使用方法)
在/etc/profile文件末尾增加以下配置:
export M2_HOME=/opt/build/apache-maven-3.3.9 ##注意这里是maven的安装路径
export PATH=${M2_HOME}/bin:${PATH}
3. 重载/etc/profile这个文件
source /etc/profile
4. 检验maven是否安装成功:mvn -v
[root@VM_0_15_centos soft]# mvn -version
which: no javac in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/build/apache-maven-3.3./bin)
which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/build/apache-maven-3.3./bin)
Error: JAVA_HOME is not defined correctly.
We cannot execute
提示需要JDK
5.安装jdk
下载(以下url没有带oracle网站的参数,会下载失败。各位同学下载时,需要使用浏览器,点开开支链接,下载后上传,或copy正在下载的下载链接)
http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz?AuthParam=1523346641_bdbdd5a4fe9c0f61245983c83cd6a628
wget http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz
.解压安装(当前目录为/opt/jdk):
tar -zxvf jdk-8u161-linux-x64.tar.gz 配置环境变量
使用vim编辑/etc/profile文件
命令:vim /etc/profile(提示:vim使用方法)
在/etc/profile文件末尾增加以下配置:
export JAVA_HOME=/opt/jdk/jdk1..0_161
export PATH=$PATH:/$JAVA_HOME/bin . 重载/etc/profile这个文件
source /etc/profile . 检验JDK是否安装成功:java -version
[root@VM_0_15_centos jdk1..0_161]# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) -Bit Server VM (build 25.161-b12, mixed mode) [root@VM_0_15_centos jdk1..0_161]# mvn -v
Apache Maven 3.3. (bb52d8502b132ec0a5a3f4c09453c07478323dc5; --11T00::+:)
Maven home: /opt/build/apache-maven-3.3.
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /opt/jdk/jdk1..0_161/jre
Default locale: en_US, platform encoding: UTF-
OS name: "linux", version: "3.10.0-514.26.2.el7.x86_64", arch: "amd64", family: "unix"
[root@VM_0_15_centos jdk1..0_161]#
3.1.3配置jdk环境
为了明确分类 我在 cd/home 目录下创建了一个java目录 在java目录下又创建了 jdk目录
然后使用cp jdk1.8.0. /home/java/jdk/命令 把解压后的jdk1.8.0.121复制到 jdk目录下
如果 cp 命名不行 就采用 mv 命令进行移动mv jdk1.8.0. /home/java/jdk/
3.1.4设置环境变量
注意:在设置环境变量的同时首先要执行该命令 : vi ~/.bashrc
然后以下几行 分步执行:
export JAVA_HOME=/home/java/jdk/jdk1..0_121
export CLASSPATH=${JAVA_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH 3.1..使修改立即生效
执行:source ~/.bashrc 3.1..验证
执行java -version
在阿里云的CentOS环境中安装配置MySQL、JDK、Maven的更多相关文章
- 在阿里云的CentOS环境中安装django
购买了一台阿里云主机.操作系统为CentOS 6.5.准备在上面跑Django做Web开发.因为CentOS自带的python版本号较低,安装Django先要安装新版本号python.还是费了点周折. ...
- 如何在CentOS系统中安装配置SNMP服务
CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统)是Linux发行版之一,现在有一大部分服务器在使用此操作系统:SNMP(简单网络 ...
- 在CentOS 6 中安装 Apache,Mysql, PHP
1.安装Apache 在终端中输入以下的命令就能够安装Apache了: sudo yum install httpd sudo的意思是用root用户做什么操作.要点击y就确认下载安装了,非常方便. 然 ...
- 详解在Linux中安装配置MySQL
最近在整理自己私人服务器上的各种阿猫阿狗,正好就顺手详细记录一下清理之后重装的步骤,今天先写点数据库的内容,关于在Linux中安装配置MySQL 安装环境 CentOS7 + MySQL5.7 下载安 ...
- 在阿里云服务器中安装配置mysql数据库完整教程
阿里云ECS服务器CentOS7上安装MySql服务 (可选)1.确保服务器系统处于最新状态 [root@localhost ~]# yum -y update如果显示以下内容说明已经更新完成 Rep ...
- 阿里云万网虚拟主机安装配置Https(SSL)教程
太多太多的用户咨询阿里云虚拟主机是否可以安装SSL数字证书?万网空间是否可以支持HTTPS协议访问网站?答案只有一个:目前阿里云虚拟主机都不支持安装SSL证书!但是,但是,可以曲线实现目标! 1.为了 ...
- 阿里云服务器centos7环境下安装xampp后,mysql有进程,但是却没有监听3306端口
配置阿里云服务器centos7中xampp环境时出现了一种情况: 在centos中可以使用命令进入mysql 修改后也可以远程用phpmyadmin连接mysql 但是用navicat却无法连接 先修 ...
- 阿里云服务器Centos上Apache安装SSL证书配置Https
首先我们先去阿里云申请一个免费的SSL证书(https://common-buy.aliyun.com/?spm=5176.7968328.1266638..5e971232BzMSp5&co ...
- 阿里云入坑指南&&nodejs 安装配置
买了阿里云1G1核1M的机器(800元,3年) 登录阿里云-实例-选择实例所在地区-重置密码 用公网IP ssh连接 #升级CentOS yum -y update #安装or更新组件 yum -y ...
随机推荐
- TCP的核心系列 — ACK的处理(一)
TCP发送数据包后,会收到对端的ACK.通过处理ACK,TCP可以进行拥塞控制和流控制,所以 ACK的处理是TCP的一个重要内容.tcp_ack()用于处理接收到的ACK. 本文主要内容:TCP接收A ...
- 文档流 css中的float clear与布局
文档流 先说说什么是文档流 流是什么 就是一串连续的东西 <div style="background-color:pink;width:40px;height:80px;" ...
- 【Qt编程】3D迷宫游戏
说起迷宫想必大家都很熟悉,个人感觉迷宫对人的方向感是很大的考验,至少我的方向感是不好的,尤其是在三维空间中.由于这段时间帮导师做项目用到了三维作图,便心血来潮想做个三维迷宫玩玩.要想画出三维的迷宫游戏 ...
- 关于NSString和NSMutableString的相关用法和基本介绍
Objective-C 中核心处理字符串的类是 NSString 与 NSMutableString ,这两个类最大的区别就是NSString 创建赋值以后该字符串的内容与长度不能在动态的更改,除非重 ...
- LeetCode(61)-Valid Palindrome
题目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ig ...
- rails将类常量重构到数据库对应的表中之二
在博文之一中我们将Order中的常量重构到了数据库的表中,也做了一些测试,貌似一切都很完美.可是...梦魔还未开始啊!我们少做了一步测试,就是rake test! 结果惨不忍睹,所有测试都是E,全部出 ...
- 基于阻塞队列的生产者消费者C#并发设计
这是从上文的<<图文并茂的生产者消费者应用实例demo>>整理总结出来的,具体就不说了,直接给出代码,注释我已经加了,原来的code请看<<.Net中的并行编程-7 ...
- 使用XStream是实现XML与Java对象的转换(4)--转换器
七.转换器(Converter) 我们程序中的POJO是千变万化的,而且需求也是千奇百怪的,所以XStream中的内置的转换器的功能不一定能够满足我们的要求,所以我们就需要自己构建转换器. 1,一个基 ...
- IndexedDB,FileSystem- 前端数据库,文件管理系统
"我们不再需要下载并且安装软件.一个简单的web浏览器和一个可供使用的互联网就足以让我们在任何时间, 任何地点, 还有任何平台上使用任何web应用程序." web应用很酷, 但是相 ...
- Django(一)入门基础——hello world
环境配置 windows7 python3.6 Django 2.0 PyCharm 2018.1 专业版(PS:不建议社区版,因为被"阉割"了很多功能,比如cmd的Termina ...