WordPress Error establishing a MySQL database connection IIS10












9















I'm trying to setup WordPress with MySQL on my local Windows 10 machine.
I'm getting this error:




Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost:3307. This could mean your host's database server is down.




I already checked here: Error establishing a database connection on wordpress




  1. Are you sure you have the correct username and password?

    Yes, I can login to SQL Server Workbench with the root credentials, so that is working

  2. Are you sure that you have typed the correct hostname?

    That's what I'm trying below

  3. Are you sure that the database server is running?

    Yes, checked in MySQL workbench and it's running


I ran this query select @@hostname which gives me: DESKTOP-CFT2ESY



I tried adding to wp-config.php (not all at the same time):



define('DB_HOST', 'localhost:3307');
define('DB_HOST', 'localhost:8899');
define('DB_HOST', 'localhost');
define('DB_HOST', 'DESKTOP-CFT2ESY');
define('DB_HOST', '127.0.0.1');



None of these work, it just changes the hostname string in the above error message.



I then added:
define('WP_ALLOW_REPAIR', true);
define('DB_CHARSET', 'utf8');



But that does not change the error message at all.



UPDATE 1



I ran SHOW GLOBAL VARIABLES LIKE 'PORT'; and my server runs on port 3306. In WorkBench I see my database is up and running.
I also added all privileges for user root on my database schema. My user's Limit to hosts matching is set to localhost.



UPDATE 2



I then ran this PHP code which I found here (I just changed the root user's password to my root user's password):



<?php

$host="localhost";

$root="root";
$root_password="rootpass";

$user='newuser';
$pass='newpass';
$db="newdb";

try {
$dbh = new PDO("mysql:host=$host", $root, $root_password);

$dbh->exec("CREATE DATABASE `$db`;
CREATE USER '$user'@'localhost' IDENTIFIED BY '$pass';
GRANT ALL ON `$db`.* TO '$user'@'localhost';
FLUSH PRIVILEGES;")
or die(print_r($dbh->errorInfo(), true));

} catch (PDOException $e) {
die("DB ERROR: ". $e->getMessage());
}
?>


But this trows the error:




DB ERROR: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers




UPDATE 3



I then ran query: SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "myDB"; which returns utf8, so the same character set as defined in my wp-config.php.



UPDATE 4

I checked here. I just had a mysqlrouter.conf.sample in my C:Program FilesMySQLMySQL Server 8.0etc folder, so I added a my.cnf file with:



[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8


I restarted the MySQL windows service but the error remains the same.



What else can I try?










share|improve this question




















  • 1





    Your host does not seem to be the problem ... leave it to localhost. Make sure DB_NAME, DB_USER, DB_PASSWORD is well defined. Maby a type in one of them?

    – Patrick Simard
    Dec 30 '18 at 16:41













  • You keep overwriting those, so only the last one takes effect.

    – Funk Forty Niner
    Dec 30 '18 at 16:47






  • 1





    Lol i am pretty sure he was just listing what he tryed

    – Patrick Simard
    Dec 30 '18 at 16:49











  • @PatrickSimard: I was indeed listing what I tried :-), I also rechecked name/user/password and literally copied them in workbench to test and it works there, so no typos. What else could it be? I'm running MySQL as a Windows service if that matters.

    – Flo
    Dec 31 '18 at 15:26






  • 1





    this help: stackoverflow.com/questions/43437490/… ?

    – treyBake
    Jan 2 at 14:43
















9















I'm trying to setup WordPress with MySQL on my local Windows 10 machine.
I'm getting this error:




Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost:3307. This could mean your host's database server is down.




I already checked here: Error establishing a database connection on wordpress




  1. Are you sure you have the correct username and password?

    Yes, I can login to SQL Server Workbench with the root credentials, so that is working

  2. Are you sure that you have typed the correct hostname?

    That's what I'm trying below

  3. Are you sure that the database server is running?

    Yes, checked in MySQL workbench and it's running


I ran this query select @@hostname which gives me: DESKTOP-CFT2ESY



I tried adding to wp-config.php (not all at the same time):



define('DB_HOST', 'localhost:3307');
define('DB_HOST', 'localhost:8899');
define('DB_HOST', 'localhost');
define('DB_HOST', 'DESKTOP-CFT2ESY');
define('DB_HOST', '127.0.0.1');



None of these work, it just changes the hostname string in the above error message.



I then added:
define('WP_ALLOW_REPAIR', true);
define('DB_CHARSET', 'utf8');



But that does not change the error message at all.



UPDATE 1



I ran SHOW GLOBAL VARIABLES LIKE 'PORT'; and my server runs on port 3306. In WorkBench I see my database is up and running.
I also added all privileges for user root on my database schema. My user's Limit to hosts matching is set to localhost.



UPDATE 2



I then ran this PHP code which I found here (I just changed the root user's password to my root user's password):



<?php

$host="localhost";

$root="root";
$root_password="rootpass";

$user='newuser';
$pass='newpass';
$db="newdb";

try {
$dbh = new PDO("mysql:host=$host", $root, $root_password);

$dbh->exec("CREATE DATABASE `$db`;
CREATE USER '$user'@'localhost' IDENTIFIED BY '$pass';
GRANT ALL ON `$db`.* TO '$user'@'localhost';
FLUSH PRIVILEGES;")
or die(print_r($dbh->errorInfo(), true));

} catch (PDOException $e) {
die("DB ERROR: ". $e->getMessage());
}
?>


But this trows the error:




DB ERROR: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers




UPDATE 3



I then ran query: SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "myDB"; which returns utf8, so the same character set as defined in my wp-config.php.



UPDATE 4

I checked here. I just had a mysqlrouter.conf.sample in my C:Program FilesMySQLMySQL Server 8.0etc folder, so I added a my.cnf file with:



[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8


I restarted the MySQL windows service but the error remains the same.



What else can I try?










share|improve this question




















  • 1





    Your host does not seem to be the problem ... leave it to localhost. Make sure DB_NAME, DB_USER, DB_PASSWORD is well defined. Maby a type in one of them?

    – Patrick Simard
    Dec 30 '18 at 16:41













  • You keep overwriting those, so only the last one takes effect.

    – Funk Forty Niner
    Dec 30 '18 at 16:47






  • 1





    Lol i am pretty sure he was just listing what he tryed

    – Patrick Simard
    Dec 30 '18 at 16:49











  • @PatrickSimard: I was indeed listing what I tried :-), I also rechecked name/user/password and literally copied them in workbench to test and it works there, so no typos. What else could it be? I'm running MySQL as a Windows service if that matters.

    – Flo
    Dec 31 '18 at 15:26






  • 1





    this help: stackoverflow.com/questions/43437490/… ?

    – treyBake
    Jan 2 at 14:43














9












9








9


1






I'm trying to setup WordPress with MySQL on my local Windows 10 machine.
I'm getting this error:




Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost:3307. This could mean your host's database server is down.




I already checked here: Error establishing a database connection on wordpress




  1. Are you sure you have the correct username and password?

    Yes, I can login to SQL Server Workbench with the root credentials, so that is working

  2. Are you sure that you have typed the correct hostname?

    That's what I'm trying below

  3. Are you sure that the database server is running?

    Yes, checked in MySQL workbench and it's running


I ran this query select @@hostname which gives me: DESKTOP-CFT2ESY



I tried adding to wp-config.php (not all at the same time):



define('DB_HOST', 'localhost:3307');
define('DB_HOST', 'localhost:8899');
define('DB_HOST', 'localhost');
define('DB_HOST', 'DESKTOP-CFT2ESY');
define('DB_HOST', '127.0.0.1');



None of these work, it just changes the hostname string in the above error message.



I then added:
define('WP_ALLOW_REPAIR', true);
define('DB_CHARSET', 'utf8');



But that does not change the error message at all.



UPDATE 1



I ran SHOW GLOBAL VARIABLES LIKE 'PORT'; and my server runs on port 3306. In WorkBench I see my database is up and running.
I also added all privileges for user root on my database schema. My user's Limit to hosts matching is set to localhost.



UPDATE 2



I then ran this PHP code which I found here (I just changed the root user's password to my root user's password):



<?php

$host="localhost";

$root="root";
$root_password="rootpass";

$user='newuser';
$pass='newpass';
$db="newdb";

try {
$dbh = new PDO("mysql:host=$host", $root, $root_password);

$dbh->exec("CREATE DATABASE `$db`;
CREATE USER '$user'@'localhost' IDENTIFIED BY '$pass';
GRANT ALL ON `$db`.* TO '$user'@'localhost';
FLUSH PRIVILEGES;")
or die(print_r($dbh->errorInfo(), true));

} catch (PDOException $e) {
die("DB ERROR: ". $e->getMessage());
}
?>


But this trows the error:




DB ERROR: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers




UPDATE 3



I then ran query: SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "myDB"; which returns utf8, so the same character set as defined in my wp-config.php.



UPDATE 4

I checked here. I just had a mysqlrouter.conf.sample in my C:Program FilesMySQLMySQL Server 8.0etc folder, so I added a my.cnf file with:



[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8


I restarted the MySQL windows service but the error remains the same.



What else can I try?










share|improve this question
















I'm trying to setup WordPress with MySQL on my local Windows 10 machine.
I'm getting this error:




Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost:3307. This could mean your host's database server is down.




I already checked here: Error establishing a database connection on wordpress




  1. Are you sure you have the correct username and password?

    Yes, I can login to SQL Server Workbench with the root credentials, so that is working

  2. Are you sure that you have typed the correct hostname?

    That's what I'm trying below

  3. Are you sure that the database server is running?

    Yes, checked in MySQL workbench and it's running


I ran this query select @@hostname which gives me: DESKTOP-CFT2ESY



I tried adding to wp-config.php (not all at the same time):



define('DB_HOST', 'localhost:3307');
define('DB_HOST', 'localhost:8899');
define('DB_HOST', 'localhost');
define('DB_HOST', 'DESKTOP-CFT2ESY');
define('DB_HOST', '127.0.0.1');



None of these work, it just changes the hostname string in the above error message.



I then added:
define('WP_ALLOW_REPAIR', true);
define('DB_CHARSET', 'utf8');



But that does not change the error message at all.



UPDATE 1



I ran SHOW GLOBAL VARIABLES LIKE 'PORT'; and my server runs on port 3306. In WorkBench I see my database is up and running.
I also added all privileges for user root on my database schema. My user's Limit to hosts matching is set to localhost.



UPDATE 2



I then ran this PHP code which I found here (I just changed the root user's password to my root user's password):



<?php

$host="localhost";

$root="root";
$root_password="rootpass";

$user='newuser';
$pass='newpass';
$db="newdb";

try {
$dbh = new PDO("mysql:host=$host", $root, $root_password);

$dbh->exec("CREATE DATABASE `$db`;
CREATE USER '$user'@'localhost' IDENTIFIED BY '$pass';
GRANT ALL ON `$db`.* TO '$user'@'localhost';
FLUSH PRIVILEGES;")
or die(print_r($dbh->errorInfo(), true));

} catch (PDOException $e) {
die("DB ERROR: ". $e->getMessage());
}
?>


But this trows the error:




DB ERROR: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers




UPDATE 3



I then ran query: SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "myDB"; which returns utf8, so the same character set as defined in my wp-config.php.



UPDATE 4

I checked here. I just had a mysqlrouter.conf.sample in my C:Program FilesMySQLMySQL Server 8.0etc folder, so I added a my.cnf file with:



[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8


I restarted the MySQL windows service but the error remains the same.



What else can I try?







php mysql wordpress iis-10 mysql-8.0






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 17:12







Flo

















asked Dec 30 '18 at 16:35









FloFlo

2,7392077145




2,7392077145








  • 1





    Your host does not seem to be the problem ... leave it to localhost. Make sure DB_NAME, DB_USER, DB_PASSWORD is well defined. Maby a type in one of them?

    – Patrick Simard
    Dec 30 '18 at 16:41













  • You keep overwriting those, so only the last one takes effect.

    – Funk Forty Niner
    Dec 30 '18 at 16:47






  • 1





    Lol i am pretty sure he was just listing what he tryed

    – Patrick Simard
    Dec 30 '18 at 16:49











  • @PatrickSimard: I was indeed listing what I tried :-), I also rechecked name/user/password and literally copied them in workbench to test and it works there, so no typos. What else could it be? I'm running MySQL as a Windows service if that matters.

    – Flo
    Dec 31 '18 at 15:26






  • 1





    this help: stackoverflow.com/questions/43437490/… ?

    – treyBake
    Jan 2 at 14:43














  • 1





    Your host does not seem to be the problem ... leave it to localhost. Make sure DB_NAME, DB_USER, DB_PASSWORD is well defined. Maby a type in one of them?

    – Patrick Simard
    Dec 30 '18 at 16:41













  • You keep overwriting those, so only the last one takes effect.

    – Funk Forty Niner
    Dec 30 '18 at 16:47






  • 1





    Lol i am pretty sure he was just listing what he tryed

    – Patrick Simard
    Dec 30 '18 at 16:49











  • @PatrickSimard: I was indeed listing what I tried :-), I also rechecked name/user/password and literally copied them in workbench to test and it works there, so no typos. What else could it be? I'm running MySQL as a Windows service if that matters.

    – Flo
    Dec 31 '18 at 15:26






  • 1





    this help: stackoverflow.com/questions/43437490/… ?

    – treyBake
    Jan 2 at 14:43








1




1





Your host does not seem to be the problem ... leave it to localhost. Make sure DB_NAME, DB_USER, DB_PASSWORD is well defined. Maby a type in one of them?

– Patrick Simard
Dec 30 '18 at 16:41







Your host does not seem to be the problem ... leave it to localhost. Make sure DB_NAME, DB_USER, DB_PASSWORD is well defined. Maby a type in one of them?

– Patrick Simard
Dec 30 '18 at 16:41















You keep overwriting those, so only the last one takes effect.

– Funk Forty Niner
Dec 30 '18 at 16:47





You keep overwriting those, so only the last one takes effect.

– Funk Forty Niner
Dec 30 '18 at 16:47




1




1





Lol i am pretty sure he was just listing what he tryed

– Patrick Simard
Dec 30 '18 at 16:49





Lol i am pretty sure he was just listing what he tryed

– Patrick Simard
Dec 30 '18 at 16:49













@PatrickSimard: I was indeed listing what I tried :-), I also rechecked name/user/password and literally copied them in workbench to test and it works there, so no typos. What else could it be? I'm running MySQL as a Windows service if that matters.

– Flo
Dec 31 '18 at 15:26





@PatrickSimard: I was indeed listing what I tried :-), I also rechecked name/user/password and literally copied them in workbench to test and it works there, so no typos. What else could it be? I'm running MySQL as a Windows service if that matters.

– Flo
Dec 31 '18 at 15:26




1




1





this help: stackoverflow.com/questions/43437490/… ?

– treyBake
Jan 2 at 14:43





this help: stackoverflow.com/questions/43437490/… ?

– treyBake
Jan 2 at 14:43












2 Answers
2






active

oldest

votes


















4














As commented by @treyBake please see here.



Basically MySQL 8 changed the default charset to utfmb4 and there are now errors with some clients. I downgraded to MySQL Server 5.6 and the problem is gone.






share|improve this answer































    1














    Look here for the potential solution:



    PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers



    In essence, you have to make sure that both the DB and the script uses the same charset, preferably utf-8



    UPDATE:
    See also this:http://php.net/manual/en/mysqli.set-charset.php






    share|improve this answer





















    • 1





      See my update 3.

      – Flo
      Jan 2 at 14:22











    • I suggest to leave wp alone and try to troubleshoot the problem with the standalone script. Have you checked you MySQL connection charset?

      – Eriks Klotins
      Jan 2 at 14:40











    • That is what I tried under update 3 right? It says utf8 already.

      – Flo
      Jan 2 at 14:41











    • I am not sure how exactly the wp-config handles charsets. That is why I suggested working with the standalone script where you have full control. Importantly, the script charset, the connection charset, and the DB charset have to be the same for things to work.

      – Eriks Klotins
      Jan 2 at 14:44











    • See my update 4

      – Flo
      Jan 3 at 10:13











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53979429%2fwordpress-error-establishing-a-mysql-database-connection-iis10%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    As commented by @treyBake please see here.



    Basically MySQL 8 changed the default charset to utfmb4 and there are now errors with some clients. I downgraded to MySQL Server 5.6 and the problem is gone.






    share|improve this answer




























      4














      As commented by @treyBake please see here.



      Basically MySQL 8 changed the default charset to utfmb4 and there are now errors with some clients. I downgraded to MySQL Server 5.6 and the problem is gone.






      share|improve this answer


























        4












        4








        4







        As commented by @treyBake please see here.



        Basically MySQL 8 changed the default charset to utfmb4 and there are now errors with some clients. I downgraded to MySQL Server 5.6 and the problem is gone.






        share|improve this answer













        As commented by @treyBake please see here.



        Basically MySQL 8 changed the default charset to utfmb4 and there are now errors with some clients. I downgraded to MySQL Server 5.6 and the problem is gone.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 14:34









        FloFlo

        2,7392077145




        2,7392077145

























            1














            Look here for the potential solution:



            PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers



            In essence, you have to make sure that both the DB and the script uses the same charset, preferably utf-8



            UPDATE:
            See also this:http://php.net/manual/en/mysqli.set-charset.php






            share|improve this answer





















            • 1





              See my update 3.

              – Flo
              Jan 2 at 14:22











            • I suggest to leave wp alone and try to troubleshoot the problem with the standalone script. Have you checked you MySQL connection charset?

              – Eriks Klotins
              Jan 2 at 14:40











            • That is what I tried under update 3 right? It says utf8 already.

              – Flo
              Jan 2 at 14:41











            • I am not sure how exactly the wp-config handles charsets. That is why I suggested working with the standalone script where you have full control. Importantly, the script charset, the connection charset, and the DB charset have to be the same for things to work.

              – Eriks Klotins
              Jan 2 at 14:44











            • See my update 4

              – Flo
              Jan 3 at 10:13
















            1














            Look here for the potential solution:



            PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers



            In essence, you have to make sure that both the DB and the script uses the same charset, preferably utf-8



            UPDATE:
            See also this:http://php.net/manual/en/mysqli.set-charset.php






            share|improve this answer





















            • 1





              See my update 3.

              – Flo
              Jan 2 at 14:22











            • I suggest to leave wp alone and try to troubleshoot the problem with the standalone script. Have you checked you MySQL connection charset?

              – Eriks Klotins
              Jan 2 at 14:40











            • That is what I tried under update 3 right? It says utf8 already.

              – Flo
              Jan 2 at 14:41











            • I am not sure how exactly the wp-config handles charsets. That is why I suggested working with the standalone script where you have full control. Importantly, the script charset, the connection charset, and the DB charset have to be the same for things to work.

              – Eriks Klotins
              Jan 2 at 14:44











            • See my update 4

              – Flo
              Jan 3 at 10:13














            1












            1








            1







            Look here for the potential solution:



            PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers



            In essence, you have to make sure that both the DB and the script uses the same charset, preferably utf-8



            UPDATE:
            See also this:http://php.net/manual/en/mysqli.set-charset.php






            share|improve this answer















            Look here for the potential solution:



            PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers



            In essence, you have to make sure that both the DB and the script uses the same charset, preferably utf-8



            UPDATE:
            See also this:http://php.net/manual/en/mysqli.set-charset.php







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 2 at 14:40

























            answered Jan 2 at 14:16









            Eriks KlotinsEriks Klotins

            1,159516




            1,159516








            • 1





              See my update 3.

              – Flo
              Jan 2 at 14:22











            • I suggest to leave wp alone and try to troubleshoot the problem with the standalone script. Have you checked you MySQL connection charset?

              – Eriks Klotins
              Jan 2 at 14:40











            • That is what I tried under update 3 right? It says utf8 already.

              – Flo
              Jan 2 at 14:41











            • I am not sure how exactly the wp-config handles charsets. That is why I suggested working with the standalone script where you have full control. Importantly, the script charset, the connection charset, and the DB charset have to be the same for things to work.

              – Eriks Klotins
              Jan 2 at 14:44











            • See my update 4

              – Flo
              Jan 3 at 10:13














            • 1





              See my update 3.

              – Flo
              Jan 2 at 14:22











            • I suggest to leave wp alone and try to troubleshoot the problem with the standalone script. Have you checked you MySQL connection charset?

              – Eriks Klotins
              Jan 2 at 14:40











            • That is what I tried under update 3 right? It says utf8 already.

              – Flo
              Jan 2 at 14:41











            • I am not sure how exactly the wp-config handles charsets. That is why I suggested working with the standalone script where you have full control. Importantly, the script charset, the connection charset, and the DB charset have to be the same for things to work.

              – Eriks Klotins
              Jan 2 at 14:44











            • See my update 4

              – Flo
              Jan 3 at 10:13








            1




            1





            See my update 3.

            – Flo
            Jan 2 at 14:22





            See my update 3.

            – Flo
            Jan 2 at 14:22













            I suggest to leave wp alone and try to troubleshoot the problem with the standalone script. Have you checked you MySQL connection charset?

            – Eriks Klotins
            Jan 2 at 14:40





            I suggest to leave wp alone and try to troubleshoot the problem with the standalone script. Have you checked you MySQL connection charset?

            – Eriks Klotins
            Jan 2 at 14:40













            That is what I tried under update 3 right? It says utf8 already.

            – Flo
            Jan 2 at 14:41





            That is what I tried under update 3 right? It says utf8 already.

            – Flo
            Jan 2 at 14:41













            I am not sure how exactly the wp-config handles charsets. That is why I suggested working with the standalone script where you have full control. Importantly, the script charset, the connection charset, and the DB charset have to be the same for things to work.

            – Eriks Klotins
            Jan 2 at 14:44





            I am not sure how exactly the wp-config handles charsets. That is why I suggested working with the standalone script where you have full control. Importantly, the script charset, the connection charset, and the DB charset have to be the same for things to work.

            – Eriks Klotins
            Jan 2 at 14:44













            See my update 4

            – Flo
            Jan 3 at 10:13





            See my update 4

            – Flo
            Jan 3 at 10:13


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53979429%2fwordpress-error-establishing-a-mysql-database-connection-iis10%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas