Search code examples
phpmysqlnosqldocument-store

Invalid packet type error using php_mysql_xdevapi


I am trying to connect to mysql 8.0.15 using php_mysql_xdevapi but getting following errror.

Notice: mysql_xdevapi\getSession(): send of 5 bytes failed with errno=10053 An established connection was aborted by the software in your host machine.

Fatal error: Uncaught mysql_xdevapi\Exception: [2000][HY000] The server sent invalid packet type I am using

  • Windows 10

    • MySQL 8.0.15
    • PHP 7.3.0
    • PECL Extension MySQL X DevAPI for PHP


Solution

  • Finally after 2 days of searching, I make php_mysql_xdevapi work on windows using wampserver.

    Steps to make php_mysql_xdevapi work on windows 10, using wamp.

    1. Install Pecl extension php_mysql_xdevapi.
    2. Add the extension into the ini extension=php_mysql_xdevapi
    3. Be default in wamp the XPlugin is disable enable it in my.ini

      ;Disabling X Plugin ;mysqlx=0

    4. use this to connect to mysql using php_mysql_xdevapi

      $session = mysql_xdevapi\getSession('mysqlx://root:123@localhost:33060?connect-timeout=5000&ssl-mode=disabled');

    Now you can use this to further query in mysql document store.