免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2496 | 回复: 8
打印 上一主题 下一主题

请问各位大侠,要实现MYSQL加密传输,应该怎么做? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-05 14:22 |只看该作者 |倒序浏览
MYSQL加密传输应该怎么实现,有如下的操作步骤:
To get secure connections to work with MySQL, you must do the following:

Install the OpenSSL library. We have tested MySQL with OpenSSL 0.9.6. If you need OpenSSL, visit http://www.openssl.org.

When you configure MySQL, run the configure script with the --with-vio and --with-openssl options.

Make sure that you have upgraded your grant tables to include the SSL-related columns in the mysql.user table. This is necessary if your grant tables date from a version prior to MySQL 4.0.0. The upgrade procedure is described in Section 2.10.3, “Upgrading the Grant Tables”.

To check whether a running mysqld server supports OpenSSL, examine the value of the have_openssl system variable:

mysql> SHOW VARIABLES LIKE 'have_openssl';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_openssl  | YES   |
+---------------+-------+

If the value is YES, the server supports OpenSSL connections.

可是这里的第二步configure MYSQL要怎么做?
请大侠们帮帮忙,谢谢!

论坛徽章:
0
2 [报告]
发表于 2006-01-06 09:42 |只看该作者
有没有做过MYSQL的加密传输,帮帮忙

论坛徽章:
0
3 [报告]
发表于 2006-01-06 13:13 |只看该作者
利用openssh做隧道穿透,大致是这么个意思,你找找相关的资料吧,我也没搞过。

论坛徽章:
0
4 [报告]
发表于 2006-01-06 13:29 |只看该作者
偶也没搞过呢。

论坛徽章:
0
5 [报告]
发表于 2006-01-06 14:18 |只看该作者
--with-vio and --with-openssl

论坛徽章:
0
6 [报告]
发表于 2006-01-06 16:50 |只看该作者
可我安装MYSQL老是不成功,唉
继续研究中。。。
问一下rpm安装时能不能使用这两项(--with-vio和--with-openssl),要怎么用?谢谢大家!

[ 本帖最后由 lmclmc000 于 2006-1-6 16:52 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2006-01-11 09:53 |只看该作者
问题已解决,谢谢swingcoder。
以后将整理一下文档,谢谢大家。

论坛徽章:
0
8 [报告]
发表于 2006-01-13 10:49 |只看该作者

MYSQL加密连接安装步骤

首先要下载MYSQL源代码包,进行安装:
shell> groupadd mysql
shell> useradd -g mysql mysql

shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION

shell> ./configure --prefix=/usr/local/mysql --with –openssl --with -vio
//这个步骤就是上面说的configure MYSQL
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .

shell> bin/mysqld_safe --user=mysql &
这时MYSQL已安装完,接着修改mysql密码及访问权限

shell> cd /usr/local/mysql/bin/
shell> ./mysql -u root –p

mysql> INSERT INTO mysql.user VALUES ('%','root', PASSWORD('1qw23e'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','X509','','','',0,0,0,0);
其中user表的ssl_type字段值设为x509
然后要生成ssl证书并修改my.cnf,详见http://dev.mysql.com/doc/refman/5.0/en/secure-create-certs.html
重启一下mysql,加密连接就生效了。客户端连接mysql时就得提供ssl证书。

论坛徽章:
0
9 [报告]
发表于 2006-03-31 15:32 |只看该作者
您客户端 使用命令行操作?有没有尝试成功过编程开发包传输加密??
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP