1、复制mysql代码。
从策划到设计制作,每一步都追求做到细腻,制作可持续发展的企业网站。为客户提供成都网站建设、网站建设、网站策划、网页设计、空间域名、网络空间、网络营销、VI设计、 网站改版、漏洞修补等服务。为客户提供更好的一站式互联网解决方案,以客户的口碑塑造优易品牌,携手广大客户,共同发展进步。
2、进入空间,找到自定义,点击自定义。
3、将代码粘贴到地址栏里。
4、按Enter键点击保存即可。
mysql tee F:\php_demo\mysql\sqltext.txt
Logging to file 'F:\php_demo\mysql\sqltext.txt'
退出
mysql notee
Outfile disabled.
mysql \T F:\php_demo\mysql\sqltext.txt
Logging to file 'F:\php_demo\mysql\sqltext.txt'
退出
mysql \t
Outfile disabled.
mysql表里面搞个longblob字段保存word
代码:
1)上传
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url ="jdbc:mysql://localhost/test?user=rootpassword=rootuseUnicode=truecharacterEncoding=gbk";
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
stmt.execute("insert into test(myid) values (5)");
stmt.close();
PreparedStatement pstmt = null;
String sql = "";
File file = new File("c:\\kick.jpg");
InputStream photoStream = new FileInputStream(file);
sql = " UPDATE test SET photo = ? WHERE myid = 5" ;
pstmt = conn.prepareStatement(sql);
pstmt.setBinaryStream(1, photoStream, (int)file.length());
pstmt.executeUpdate();
pstmt.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
2)下载:
PreparedStatement pst = ..... //省略获取Connection及查询的sql
ResultSet rs = pst.executeQuery();
InputStream is = rs.getBinaryStream(1); //1表示你的word字段在结果集中的索引号
FileOutputStream fos = new FileOutputStream("path");
byte [] buf = new byte[1024];
while(is.read(buf)!=-1){
fos.write(buf);
}
//close省略
大概思路,自己完善
设置数据类型为VARCHAR,字段长度大一点,就可以存文本 ,数据量太多会影响MYSQL速度,不过你也可以使用TEXT类型,存放大量数据
分享题目:MySQL怎么保存文本 mysql怎样保存文件
文章路径:https://www.cdcxhl.com/article2/dogsioc.html
成都网站建设公司_创新互联,为您提供关键词优化、网站排名、用户体验、企业网站制作、标签优化、自适应网站
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联