{"id":13376190,"url":"https://github.com/backendrulz/MySQLTunnel","last_synced_at":"2025-03-13T01:31:56.181Z","repository":{"id":2663244,"uuid":"3654455","full_name":"backendrulz/MySQLTunnel","owner":"backendrulz","description":"A http MySQL remote tunnel","archived":true,"fork":false,"pushed_at":"2017-05-14T20:10:27.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T11:07:05.181Z","etag":null,"topics":["database","mysql","mysql-tunnel-client","php","tunnel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ibireme/YYKit","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/backendrulz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-07T22:40:47.000Z","updated_at":"2023-01-28T07:48:10.000Z","dependencies_parsed_at":"2022-08-29T10:10:41.894Z","dependency_job_id":null,"html_url":"https://github.com/backendrulz/MySQLTunnel","commit_stats":null,"previous_names":["cristianefe/mysqltunnel"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backendrulz%2FMySQLTunnel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backendrulz%2FMySQLTunnel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backendrulz%2FMySQLTunnel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backendrulz%2FMySQLTunnel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backendrulz","download_url":"https://codeload.github.com/backendrulz/MySQLTunnel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243125540,"owners_count":20240276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","mysql","mysql-tunnel-client","php","tunnel"],"created_at":"2024-07-30T05:02:33.342Z","updated_at":"2025-03-13T01:31:55.925Z","avatar_url":"https://github.com/backendrulz.png","language":"PHP","funding_links":[],"categories":["\u003ca id=\"01e6651181d405ecdcd92a452989e7e0\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"9d6789f22a280f5bb6491d1353b02384\"\u003e\u003c/a\u003e隧道\u0026\u0026穿透"],"readme":"# MySQLTunnel #\nA http MySQL remote tunnel  \n\n## Local use ##\nOpen index.php and put your database params and tunnel.\n```\ninclude 'tunnel.class.php';\n\n$cfg = array('tunnel_url' =\u003e 'http://localhost/MySQLTunnel/remote.tunnel.php',\n\t\t'db_data' =\u003e array(\n\t\t\t'host' =\u003e 'localhost',//default is localhost\n\t\t\t'user' =\u003e 'YOUR USER',\n\t\t\t'pass' =\u003e 'YOUR PASS',\n\t\t\t'db_name' =\u003e 'YOUR DATABASE',\n\t\t\t'port' =\u003e '3306'));//default mysql port is 3306\n\n\n$mysql = new Mysql_tunnel_client($cfg);\n```\nWrite a new query for the database  \n```\n$query = 'SELECT * FROM characters WHERE level = 85 LIMIT 5';\n$q = $mysql-\u003equery($query);\n\n```\n## Remote Use ##\nCheck your ip address and add it in the list of allowed ips in remote.tunnel.php like this.  \n```\nclass Mysql_tunnel_server{\n        private $db, $link;\n        public $errors = array();\n        public $ips = array('127.0.0.1','2.87.9090.244'); //Add here allowed ips\n````\n\nUpload remote.tunnel.php on your domain.\nInsert the link of remote tunnel\n```\n$cfg = array('tunnel_url' =\u003e 'http://www.yourdomain.com/MySQLTunnel/remote.tunnel.php',\n```\nHave fun!\n\n## Security ##\nDatabases credential are transmitted via http.  \nOnly if you are on the list of allowed ips you can fetch the query.\n\n\n## Mysql_tunnel_client class ##\nTo use **mysqltunnel**, first we need to include the **Mysql_tunnel_client** class file, create an array with the **database** params and then assign the class to a new variable.\nThe **$cfg** array consists of the following data:  \n\n- **tunnel_url**: the url of the remote tunnel.php file\n- **db_data**\n  - **host**: the host of mysql in the remote machine (default is localhost)\n  - **user**: username of remote mysql\n  - **pass**: password of remote mysql\n  - **db_name**: the database name to use  \n  - **port**: port to connect to mysql database default is 3306\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackendrulz%2FMySQLTunnel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackendrulz%2FMySQLTunnel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackendrulz%2FMySQLTunnel/lists"}