navicat 可以使用 ntunnel_mysql.php 当作代理来连接 mysql服务器.
http://www.navicat.com/manual/online_manual/en/navicat/rv_manual/https...
有没有开源的替代方案, 可以让mysql命令行通过http来连接mysql服务器
注:
1. 感谢各位的回答, 题主需要的是使用php来做代理转发mysql请求.
2. 题目的情况是这样的,
web server(只能通过http协议连接外部网络)----外部web server(通过php转发mysql)----外部mysql server
回复内容: navicat 可以使用 ntunnel_mysql.php 当作代理来连接 mysql服务器.
http://www.navicat.com/manual/online_manual/en/navicat/rv_manual/https...
有没有开源的替代方案, 可以让mysql命令行通过http来连接mysql服务器
注:
1. 感谢各位的回答, 题主需要的是使用php来做代理转发mysql请求.
2. 题目的情况是这样的,
web server(只能通过http协议连接外部网络)----外部web server(通过php转发mysql)----外部mysql server
我觉得个人使用没有必要用http协议来做隧道,navicat这个方案主要是考虑到它方便部署。如果你只是想穿透内网的话,其实你可以用qtunnel这类隧道搭建,还可以加密传输更加安全。而且实际上是把服务器上的mysql映射到了本地,你可以用任何mysql客户端去连接这个端口
http 本身用的是http的协议, mysql 连接mysql server 用的时mysql的协议, 两个协议怎么能直接互换呢, 就像你说的, 只能使用代理实现, 而不能直接使用http协议去连接mysql. 假如真的这样了, 通过http就能连接数据库, 那所有人只要拿到了接口, 就能操作数据库, 得多可怕
先谢邀。
我帮你贴出来了。
捡你看得懂的看。
shell[root /]# mysql --helpmysql ver 14.14 distrib 5.1.73, for redhat-linux-gnu (i386) using readline 5.1copyright (c) 2000, 2013, oracle and/or its affiliates. all rights reserved.oracle is a registered trademark of oracle corporation and/or itsaffiliates. other names may be trademarks of their respectiveowners.usage: mysql [options] [database] -?, --help display this help and exit. -i, --help synonym for -? --auto-rehash enable automatic rehashing. one doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. disable with --disable-auto-rehash. -a, --no-auto-rehash no automatic rehashing. one has to use 'rehash' to get table and field completion. this gives a quicker start of mysql and disables rehashing on reconnect. -b, --batch don't use history file. disable interactive behavior. (enables --silent.) --character-sets-dir=name directory for character set files. --column-type-info display column type information. -c, --comments preserve comments. send comments to the server. the default is --skip-comments (discard comments), enable with --comments. -c, --compress use compression in server/client protocol. -#, --debug[=#] this is a non-debug version. catch this and exit. --debug-check check memory and open file usage at exit. -t, --debug-info print some debug info at exit. -d, --database=name database to use. --default-character-set=name set the default character set. --delimiter=name delimiter to be used. -e, --execute=name execute command and quit. (disables --force and history file.) -e, --vertical print the output of a query (rows) vertically. -f, --force continue even if we get an sql error. -g, --named-commands enable named commands. named commands mean this program's internal commands; see mysql> help . when enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. disable with --disable-named-commands. this option is disabled by default. -g, --no-named-commands named commands are disabled. use \* form only, or use named commands only in the beginning of a line ending with a semicolon (;). since version 10.9, the client now starts with this option enabled by default. disable with '-g'. long format commands still work from the first line. warning: option deprecated; use --disable-named-commands instead. -i, --ignore-spaces ignore space after function names. --local-infile enable/disable load data local infile. -b, --no-beep turn off beep on error. -h, --host=name connect to host. -h, --html produce html output. -x, --xml produce xml output. --line-numbers write line numbers for errors. -l, --skip-line-numbers don't write line number for errors. -n, --unbuffered flush buffer after each query. --column-names write column names in results. -n, --skip-column-names don't write column names in results. -o, --set-variable=name change the value of a variable. please note that this option is deprecated; you can set variables directly with --variable-name=value. --sigint-ignore ignore sigint (ctrl-c). -o, --one-database ignore statements except those that occur while the default database is the one named at the command line. --pager[=name] pager to use to display results. if you don't supply an option, the default pager is taken from your env variable pager. valid pagers are less, more, cat [> filename], etc. see interactive help (\h) also. this option does not work in batch mode. disable with --disable-pager. this option is disabled by default. --no-pager disable pager and print to stdout. see interactive help (\h) also. warning: option deprecated; use --disable-pager instead. -p, --password[=name] password to use when connecting to server. if password is not given it's asked from the tty. -p, --port=# port number to use for connection or 0 for default to, in order of preference, my.cnf, $mysql_tcp_port, /etc/services, built-in default (3306). --prompt=name set the mysql prompt to this value. --protocol=name the protocol to use for connection (tcp, socket, pipe, memory). -q, --quick don't cache result, print it row by row. this may slow down the server if the output is suspended. doesn't use history file. -r, --raw write fields without conversion. used with --batch. --reconnect reconnect if the connection is lost. disable with --disable-reconnect. this option is enabled by default. -s, --silent be more silent. print results with a tab as separator, each row on new line. -s, --socket=name the socket file to use for connection. --ssl enable ssl for connection (automatically enabled with other flags).disable with --skip-ssl. --ssl-ca=name ca file in pem format (check openssl docs, implies --ssl). --ssl-capath=name ca directory (check openssl docs, implies --ssl). --ssl-cert=name x509 cert in pem format (implies --ssl). --ssl-cipher=name ssl cipher to use (implies --ssl). --ssl-key=name x509 key in pem format (implies --ssl). --ssl-verify-server-cert verify server's common name in its cert against hostname used when connecting. this option is disabled by default. -t, --table output in table format. --tee=name append everything into outfile. see interactive help (\h) also. does not work in batch mode. disable with --disable-tee. this option is disabled by default. --no-tee disable outfile. see interactive help (\h) also. warning: option deprecated; use --disable-tee instead. -u, --user=name user for login if not current user. -u, --safe-updates only allow update and delete that uses keys. -u, --i-am-a-dummy synonym for option --safe-updates, -u. -v, --verbose write more. (-v -v -v gives the table output format). -v, --version output version information and exit. -w, --wait wait and retry if connection is down. --connect_timeout=# number of seconds before connection timeout. --max_allowed_packet=# the maximum packet length to send to or receive from server. --net_buffer_length=# the buffer size for tcp/ip and socket communication. --select_limit=# automatic limit for select when using --safe-updates. --max_join_size=# automatic limit for rows in a join when using --safe-updates. --secure-auth refuse client connecting to server if it uses old (pre-4.1.1) protocol. --server-arg=name send embedded server this as a parameter. --show-warnings show warnings after every statement.default options are read from the following files in the given order:/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf the following groups are read: mysql clientthe following options may be given as the first argument:--print-defaults print the program argument list and exit.--no-defaults don't read default options from any option file.--defaults-file=# only read default options from the given file #.--defaults-extra-file=# read this file after the global files are read.variables (--variable-name=value)and boolean options {false|true} value (after reading options)--------------------------------- -----------------------------auto-rehash truecharacter-sets-dir (no default value)column-type-info falsecomments falsecompress falsedebug-check falsedebug-info falsedatabase (no default value)default-character-set latin1delimiter ;vertical falseforce falsenamed-commands falseignore-spaces falselocal-infile falseno-beep falsehost (no default value)html falsexml falseline-numbers trueunbuffered falsecolumn-names truesigint-ignore falseport 0prompt mysql> quick falseraw falsereconnect truesocket (no default value)ssl falsessl-ca (no default value)ssl-capath (no default value)ssl-cert (no default value)ssl-cipher (no default value)ssl-key (no default value)ssl-verify-server-cert falsetable falseuser (no default value)safe-updates falsei-am-a-dummy falseconnect_timeout 0max_allowed_packet 16777216net_buffer_length 16384select_limit 1000max_join_size 1000000secure-auth falseshow-warnings false