The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Azure App Service - Web Apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
MySQL In App (preview) won't allow connections RRS feed

  • Question

  • I have an App Service running Wordpress with MySQL In App (preview) for the database.  It's been running fine for a few weeks, until suddenly tonight I got an alert that my site was returning errors.  When I connect, I get "Error establishing a database connection."  Resource Explorer shows mysqld running.  When I try to Manage MySQL, I get "Cannot connect: invalid settings" from phpMyAdmin (launched from portal).

    I noticed that the environment variable MYSQLCONNSTR_localdb isn't there, though the .txt file is in data\mssql and it looks correct.  When I turn on PHP debug, I get "Warning: mysqli_real_connect(): (HY000/1862): Your password has expired. To log in you must change it using a client that supports expired passwords."  Since I've never touched this instance directly, there's no reason it should have changed.  I don't override anything with configuration.

    I tried connecting using mysql.exe from the Console, but it just says "Can't connect to MySQL server on localhost."

    What else can I possibly try, and what would have changed for this all of a sudden? I'm at my wit's end, and meanwhile my site is down.


    -- Arian T. Kulp | http://www.ariankulp.com Please remember to mark as helpful, or mark as answer if this helps you!

    Wednesday, October 26, 2016 7:13 AM

Answers

All replies

  • I have the same problem.

    Checked process explorer as instructed by this post https://blogs.msdn.microsoft.com/appserviceteam/2016/09/08/troubleshooting-faq-for-mysql-in-apppreview/ and saw that the process mysqld is not running

    Wednesday, October 26, 2016 8:46 AM
  • Same issue here. mysqld is running just fine, no issues with that. Tried several ways of fixing this: 

    - phpMyAdmin is unusable since it cannot connect either.
    - via Kudu console, mysql and mysqladmin don't allow connecting with an expired password. The --connect-expired-password flag seems unsupported with the version installed.
    - enabled / disabled the service, doesn't change a thing
    - restarted the instance 

    It seems without a way to actually get into the mysql instance there's no way to fix it. I quickly got a back-up of my site running on another instance and swapped DNS as a temporary fix to get things online again. 

    Wednesday, October 26, 2016 9:03 AM
  • I have the exact same issue. I can see the mysqld process startup with the w3wp process. I've tried restarting the web app but that doesn't help.

    In the MySQL logs I can see the exact same message :

    Your password has expired. To log in you must change it using a client that supports expired passwords.

    The site was working like a charm up until now.

    Wednesday, October 26, 2016 9:05 AM
  • Same issue in two website. (Wordpress + MySQL in-app).

    Wednesday, October 26, 2016 9:05 AM
  • Same issue in two websites running MySQL in-app.
    Wednesday, October 26, 2016 9:06 AM
  • Update: now the mysqld process is running but still no connection
    Wednesday, October 26, 2016 9:06 AM
  • Same here, tried resetting through mysqladmin.exe in Kudu too, but that doesn't help either.

    SharePoint MVP. Platform architect. Speaker. Trainer. Involuntary DBA. @ http://thomasvochten.com

    Wednesday, October 26, 2016 9:11 AM
  • Even i am facing the same problem. Database connectivity in not happening via phpmyadmin and all db related applications are crashing.
    Wednesday, October 26, 2016 9:20 AM
  • Add this configuration in your application settings: WEBSITE_MYSQL_ARGUMENTS = --default_password_lifetime=0
    Wednesday, October 26, 2016 9:33 AM
  • This seems to work.

    Elio Struyf
    http://www.eliostruyf.com

    • Proposed as answer by Elio StruyfMVP Wednesday, October 26, 2016 9:49 AM
    • Unproposed as answer by Elio StruyfMVP Wednesday, October 26, 2016 9:49 AM
    Wednesday, October 26, 2016 9:48 AM
  • It Works!

    Thanks!

    Wednesday, October 26, 2016 9:48 AM
  • That fixed it for me. Great, thanks!

    SharePoint MVP. Platform architect. Speaker. Trainer. Involuntary DBA. @ http://thomasvochten.com

    Wednesday, October 26, 2016 9:50 AM
  • It Works, 

    Thanks a ton !

    Wednesday, October 26, 2016 10:30 AM
  • Can you share a screenshot?
    Wednesday, October 26, 2016 10:50 AM
  • Same issue in two website. (Wordpress + MySQL in-app).

    Wednesday, October 26, 2016 11:10 AM
  • Add this configuration in your application settings: WEBSITE_MYSQL_ARGUMENTS = --default_password_lifetime=0
    Also had this problem, the solution above fixed it. Thanks
    Wednesday, October 26, 2016 1:40 PM
  • This worked for me. Thanks!
    Wednesday, October 26, 2016 2:08 PM
  • Add this configuration in your application settings: WEBSITE_MYSQL_ARGUMENTS = --default_password_lifetime=0

    Can you please specify where exactly this will go? I am running a web application on Fuel PHP.

    Wednesday, October 26, 2016 3:14 PM
  • Login into Azure Portal and browse to your App Service. Now click on Application Settings under Settings section. Add a key value pair WEBSITE_MYSQL_ARGUMENTS = --default_password_lifetime=0 under App Settings section.

    Wednesday, October 26, 2016 3:21 PM
  • Nice one thanks! It Works!!
    Wednesday, October 26, 2016 3:24 PM
  • Do you add it as a Type of MySQL?

    Also do I need the == and -- 

    Thanks in advance

    Wednesday, October 26, 2016 3:38 PM
  • Thank you very much for this post! Do we know what caused this to break?
    Wednesday, October 26, 2016 3:49 PM
  • We are investigating and will follow up on this forum thread with our findings.

    David

    Wednesday, October 26, 2016 4:08 PM
    Moderator
  • This works.  Why oh why was this needed all of a sudden?  Is this related to it being in preview?  You guys really need to let users know of changes like this!

    -- Arian T. Kulp | http://www.ariankulp.com Please remember to mark as helpful, or mark as answer if this helps you!

    Wednesday, October 26, 2016 4:21 PM
  • It is not intentional as of preview.  It was simply an overlook of the password policy of MySql when we initialize MySql database.  We are working toward deploying a fix.  In the meantime, do use a workaround mention above.

    AppSettings:   WEBSITE_MYSQL_ARGUMENTS = --default_password_lifetime=0

    Will update when the fix is ready and roll out.


    Suwatch

    Wednesday, October 26, 2016 5:05 PM
  • Column One: WEBSITE_MYSQL_ARGUMENTS

    Column Two: --default_password_lifetime=0

    Wednesday, October 26, 2016 6:14 PM
  • That worked perfectly! Thank you :)
    Wednesday, October 26, 2016 6:54 PM
  • Where to add it?
    Wednesday, October 26, 2016 7:01 PM
  • To update, we are in the process of deploying a global fix for this.  Will update in a few hours once deployment is done.

    Suwatch

    Wednesday, October 26, 2016 7:12 PM
  • Appreciate the patience.   The fix was deployed worldwide.  

    1. If you had put the appSettings (WEBSITE_MYSQL_ARGUMENTYS) workaround, feel free to remove it.

    2. If you just run into the issue for the first, simply go to the Portal (https://portal.azure.com/) and restart your site.

    Let us know if still issue.


    Suwatch

    Wednesday, October 26, 2016 9:12 PM
  • Yes, this fixed it. Thanks.
    Thursday, October 27, 2016 12:00 PM
  • Hi, the problem is not fixed in my webapp and if I set the appSettings, it is not saved to the settings after reloading the settings page.

    Thursday, October 27, 2016 8:29 PM
  • I am seeing the same issue... Site restarted, but now luck. If I add the app settings recommendation from above, the key:value isn't saved upon reloading the page. Note that no error is returned when I save the key:value.

    Saturday, October 29, 2016 1:28 AM
  • Ok... Might just be a stupid user (me)... It suddenly started working and not entirely sure why... I turned on the "MySQL General Log" in the MySQL In App (Preview) page and *poof*, everything was fine.
    Saturday, October 29, 2016 1:37 AM