平台部署
创新互联专注于黔西南州企业网站建设,自适应网站建设,商城系统网站开发。黔西南州网站建设公司,为黔西南州等地区提供建站服务。全流程按需定制,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务
一、安装JDK
step1.下载OracleJDK
step2. 解压
step3. 加入环境变量
具体操作如下:
lemon@ubuntu:~$ cd ~/download/
lemon@ubuntu:~/download$ wget https://download.oracle.com/otn-pub/java/jdk/13.0.2+8/d4173c853231432d94f001e99d882ca7/jdk-13.0.2_linux-x64_bin.tar.gzlemon@ubuntu:~/download$ tar vxf jdk-8u191-linux-x64.tar.gz
lemon@ubuntu:~/download$ ls #查看当前目录下的文件
jdk1.8.0_191 jdk-8u191-linux-x64.tar.gz
lemon@ubuntu:~/download$ sudo mv jdk1.8.0_191/ /usr/local/jdk1.8/ #将jdk1.8.0_191文件夹移动到/usr/local/下并重命名为jdk1.8
lemon@ubuntu:~/download$ sudo vim /etc/profile #编辑环境变量
在环境变量末尾加入如下内容:
export JAVA_HOME=/usr/local/jdk1.8
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH
保存后重新加载环境变量,使生效:
lemon@ubuntu:~/download$ source /etc/profile #刷新环境变量,使生效
lemon@ubuntu:~$ java -version#输入java -version,如显示以下信息,则JDK安装成功
java version “1.8.0_191”
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
二、安装mysql
step1. 安装MySQL并配置
step2. 创建数据库与表
由于在安装Ubuntu系统时,本人选择了安装LAMP服务,所以MySQL已安装完成,仅需设置即可启用。
测试是否安装:
lemon@ubuntu:~$ mysql #输入mysql,如出现以下提示,说明已安装mysql
ERROR 1045 (28000): Access denied for user ‘lemon’@’localhost’ (using password: NO)
如未安装:
lemon@ubuntu:~$ sudo apt-get install mysql-server
lemon@ubuntu:~$sudo apt isntall mysql-client
lemon@ubuntu:~$sudo apt install libmysqlclient-dev
如已安装:
lemon@ubuntu:~$ sudo mysql_secure_installation
两者都会进入MySQL设置过程,具体设置内容如下:
#1
VALIDATE PASSWORD PLUGIN can be used to test passwords…
Press y|Y for Yes, any other key for No: N(不启用弱密码检查)
#2
Please set the password for root here…
New password: (设置root密码)
Re-enter new password: (重复输入)
#3
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…
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y(不启用匿名用户)
#4
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? (Press y|Y for Yes, any other key for No) : Y (不允许root远程登陆)
#5
By default, MySQL comes with a database named ‘test’ that
anyone can access…
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N
#6
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y (立刻刷新权限表)
All done!
接下来进入进入MySQL进行操作:
#最新版的MySQL安装之后无法使用密码进行登陆,需要sudo登录修改登录方式
lemon@ubuntu:~$ sudo mysql -uroot -p
Enter password: (空密码)
mysql>
mysql>UPDATE mysql.user SET authentication_string=PASSWORD(‘LEMON’), plugin=’mysql_native_password’ WHERE user=’root’;
mysql> FLUSH PRIVILEGES;
mysql>exitlemon@ubuntu:~$ sudo service mysql restart
lemon@ubuntu:~$ mysql -u root -p
Enter password: (上一步设置的密码,PASSWORD括号内的)
mysql>CREATE DATABASE nutch;
mysql>USE nutch
mysql> CREATE TABLE `webpage` (
`id` varchar(767) NOT NULL,
`headers` blob,
`text` mediumtext DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`markers` blob,
`parseStatus` blob,
`modifiedTime` bigint(20) DEFAULT NULL,
`score` float DEFAULT NULL,
`typ` varchar(32) CHARACTER SET latin1 DEFAULT NULL,
`baseUrl` varchar(767) DEFAULT NULL,
`content` longblob,
`title` varchar(2048) DEFAULT NULL,
`reprUrl` varchar(767) DEFAULT NULL,
`fetchInterval` int(11) DEFAULT NULL,
`prevFetchTime` bigint(20) DEFAULT NULL,
`inlinks` mediumblob,
`prevSignature` blob,
`outlinks` mediumblob,
`fetchTime` bigint(20) DEFAULT NULL,
`retriesSinceFetch` int(11) DEFAULT NULL,
`protocolStatus` blob,
`signature` blob,
`metadata` blob,
`batchId`varchar(767)DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED
DEFAULT CHARSET=utf8mb4;
mysql>exit
*最新版本默认情况下,MySQL是不允许远程登录的,如需远程访问需要做一些修改:
lemon@ubuntu:~$sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
#将bind-address = 127.0.0.1注释掉,重启MySQL服务
lemon@ubuntu:~$sudo service mysqld start
接下来就可以通过Navicat等软件,在其他计算机访问数据库了。
这样就Ok了
香港服务器选创新互联,2H2G首月10元开通。
创新互联(www.cdcxhl.com)互联网服务提供商,拥有超过10年的服务器租用、服务器托管、云服务器、虚拟主机、网站系统开发经验。专业提供云主机、虚拟主机、域名注册、VPS主机、云服务器、香港云服务器、免备案服务器等。
当前文章:Ubuntu18.04linux系统安装JDK与Mysql的方法
URL网址:http://www.shufengxianlan.com/qtweb/news28/284128.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联