web项目上传到服务器和连接数据库的一些细节
最近把web项目上传到服务器遇到了很多麻烦,解决方法自己整理下. 1,web项目打包 在myeclipse的项目上点击右键,选择 Export... (导出),然后如图选择 点击Next 点击Browse选择要导出到哪里,然后 点击Finish即可. 2.连接服务器的工具putty 首先下载工具包 我目前
最近把web项目上传到服务器遇到了很多麻烦,解决方法自己整理下.
1,web项目打包
在myeclipse的项目上点击右键,选择Export...(导出),然后如图选择
点击Next
点击Browse选择要导出到哪里,然后
点击Finish即可.
2.连接服务器的工具putty
首先下载工具包
我目前只用到了其中的2个工具putty.exe和psftp.exe,下面依次说说用法.
1.1putty.exe
先双击或者用命令行打开,如图所示:
输入要连接的服务器的IP地址:
其他保持默认,点击打开,弹出命令行:
输入账号和密码即可登录服务器了.
1.2psftp.exe
这个主要是用来上传文件到服务器的,用命令行打开
连接服务器:
命令格式是:open 管理员账号@服务器ip地址.然后回车是输入管理员密码
上述表示已经完成了连接,接下来是上传文件到服务器,格式为:put 要上传的文件路径.如下:
回车之后即可上穿到服务器的用户目录"~"下.
3,mysql数据库的用户权限赋予
在centos中,用web项目访问数据库遇到了一点麻烦,总是连接不上数据库.
我在用yzs_feedbackSystem项目用JDBC获取test数据库时,账号和密码都是正确,可是总是获取不到,于是我想,可能是权限问题,我的解决思路是:新建一个mysql用户,把test这个数据库的权限(仅仅是这个数据库)给它,然后JDBC用它来访问,结果证明是成功的!
首先用管理员创建一个空的数据库:
mysql>create database yzs_feedbackSystem;
退出管理员,导入yzs_feedbackSystem.sql文件:
mysql -usimon -p yzs_feedbackSystem
这样就导入了.
然后我们新建一个用户名为simon,密码为123的用户
首先,你得用超级管理员登录mysql,然后执行:
mysql>create user simon@'localhost' identified by "123";
然后把数据库test的操作权限给它:
mysql>grant all on test.* TO simon identified by "123";
这样,你在yzs_feedbackSystem项目的JDBC中写上这个用户名和密码即可对此数据库进行操作.
4,目前用到的linux(centos发行版)的一些命令行:
ls:列出当前目录的内容
cd ..:返回到上一目录
cd ~:返回到用户目录
pwd:显示当前目录路径
rm -rf file/dir:直接删除文件file或者目录dir
jar -vxf *.jar/*.war:解压jar包或者war包
mv 源文件 目标:移动(剪切)
在tomcat/logs目录下有个catalina.out文件,执行:tail -f catalina.out可以动态展示tomcat日志内容

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

How to install PHPFFmpeg extension on server? Installing the PHPFFmpeg extension on the server can help us process audio and video files in PHP projects and implement functions such as encoding, decoding, editing, and processing of audio and video files. This article will introduce how to install the PHPFFmpeg extension on the server, as well as specific code examples. First, we need to ensure that PHP and FFmpeg are installed on the server. If FFmpeg is not installed, you can follow the steps below to install FFmpe

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

According to news from this website on July 23, ASUS has launched a variety of server and workstation-level products powered by AMD EPYC 4004 series processors. Note from this site: AMD launched the AM5 platform and Zen4 architecture EPYC 4004 series processors in May, offering up to 16-core 3DV-Cache specifications. ASUSProER100AB6 server ASUSProER100AB6 is a 1U rack server product equipped with EPYC Xiaolong 4004 series processor, suitable for the needs of IDC and small and medium-sized enterprises. ASUSExpertCenterProET500AB6 workstation ASUSExpertCenterProET500AB6 is a

Go builds interactive web applications that run in the browser. Steps: Create Go project and main.go file, add HTTP handler to display messages. Add forms using HTML and JavaScript for user input and submission. Add handling of POST requests in your Go application, receive user messages and return responses. Use FetchAPI to send POST requests and handle server responses.

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.
