Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>If you do <em>not</em> have control of the server</h2> <p>I just had this issue, and was able to work around it.</p> <p>First, connect to the MySQL database with an older client that doesn't mind old_passwords. Connect using the user that your script will be using.</p> <p>Run these queries:</p> <pre><code>SET SESSION old_passwords=FALSE; SET PASSWORD = PASSWORD('[your password]'); </code></pre> <p>In your PHP script, change your mysql_connect function to include the client flag 1:</p> <pre><code>define('CLIENT_LONG_PASSWORD', 1); mysql_connect('[your server]', '[your username]', '[your password]', false, CLIENT_LONG_PASSWORD); </code></pre> <p>This allowed me to connect successfully.</p> <p><em>Edit:</em> as per <a href="https://stackoverflow.com/users/291009/garland-pope">Garland Pope</a>'s comment, it may not be necessary to set CLIENT_LONG_PASSWORD manually any more in your PHP code as of PHP 5.4!</p> <p><em>Edit:</em> courtesy of <a href="https://stackoverflow.com/users/878462/antonio-bonifati">Antonio Bonifati</a>, a PHP script to run the queries for you:</p> <pre><code>&lt;?php const DB = [ 'host' =&gt; '...', # localhost may not work on some hosting 'user' =&gt; '...', 'pwd' =&gt; '...', ]; if (!mysql_connect(DB['host'], DB['user'], DB['pwd'])) { die(mysql_error()); } if (!mysql_query($query = 'SET SESSION old_passwords=FALSE')) { die($query); } if (!mysql_query($query = "SET PASSWORD = PASSWORD('" . DB['pwd'] . "')")) { die($query); } echo "Excellent, mysqli will now work"; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload