Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [markusjm@localhost compress]$ php --version
- PHP 5.6.22 (cli) (built: May 26 2016 14:22:49)
- Copyright (c) 1997-2016 The PHP Group
- Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
- [markusjm@localhost compress]$ cat compress.php
- <?php
- // $client_flags = 0;
- // works fine
- $client_flags = MYSQLI_CLIENT_COMPRESS;
- // hangs
- $mysqli = mysqli_init();
- $mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 10);
- $hostname = '127.0.0.1';
- $username = 'maxuser';
- $password = 'maxpwd';
- $port = 4008;
- $database = '';
- $socket = '';
- $mysqli->real_connect($hostname, $username, $password, $database, $port, $socket, $client_flags);
- if ($mysqli->connect_errno) {
- echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
- }
- echo $mysqli->host_info . "\n";
- $res = $mysqli->query("SELECT @@server_id id, @@hostname host");
- while ($row = $res->fetch_assoc()) {
- echo " res = " . $row['id'] . ' : ' . $row['host'] . "\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement