Chinaunix

标题: 请问各位大侠,要实现MYSQL加密传输,应该怎么做? [打印本页]

作者: lmclmc000    时间: 2006-01-05 14:22
标题: 请问各位大侠,要实现MYSQL加密传输,应该怎么做?
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要怎么做?
请大侠们帮帮忙,谢谢!
作者: lmclmc000    时间: 2006-01-06 09:42
有没有做过MYSQL的加密传输,帮帮忙
作者: yejr    时间: 2006-01-06 13:13
利用openssh做隧道穿透,大致是这么个意思,你找找相关的资料吧,我也没搞过。
作者: macrodba    时间: 2006-01-06 13:29
偶也没搞过呢。
作者: swingcoder    时间: 2006-01-06 14:18
--with-vio and --with-openssl
作者: lmclmc000    时间: 2006-01-06 16:50
可我安装MYSQL老是不成功,唉
继续研究中。。。
问一下rpm安装时能不能使用这两项(--with-vio和--with-openssl),要怎么用?谢谢大家!

[ 本帖最后由 lmclmc000 于 2006-1-6 16:52 编辑 ]
作者: lmclmc000    时间: 2006-01-11 09:53
问题已解决,谢谢swingcoder。
以后将整理一下文档,谢谢大家。
作者: lmclmc000    时间: 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证书。
作者: sundycindy    时间: 2006-03-31 15:32
您客户端 使用命令行操作?有没有尝试成功过编程开发包传输加密??




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2