_posts/2016-9-8-Troubleshooting FAQ for MySQL in-app.html [3:93]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - hide_excerpt: true ---
mksunitha
Here are some troubleshooting guidelines for MySQL in-app feature:

1. I cannot to access the database using Phpmyadmin

When you access PHPmyadmin for MySQL in-app and the page returns a login page or “cannot connect: invalid settings” error. There can be two causes for this issue: Check process explorer if MySQL is running for your web app. You can access the process explorer in the portal. Select your web app -> Tools -> Process explorer processexploreremysql There will be mysqld.exe process visible in the process explorer. If the process mysqld.exe is not visible in the process explorer, then browse the web app or ping your web app which would trigger mysqld.exe process to run. Check process explorer again to verify that mysql process is running and browse phpmyadmin. With MySQL in-app we already preconfigure and setup PHPmyadmin. If you install PHPmyadmin from Site extensions gallery, then you will end up having two instances of PHPmyadmin. To identify if you have two instances both the conditions below will be true:
  1. PHPmyadmin folder exists in D:\home\siteextensions folder
  2. web app is using MySQL in-app feature
To resolve this, remove the site extension. Access the site extension gallery and click on remove button. Restart your web app and access your database with PHPmyadmin . Check in your web app application settings if there is a connection string. PHPmyadmin uses MYSQLCONNSTR_ to connect to the MySQL server. If you have a connection string in application setting change the connection string  type to Custom , so you can still have the information if needed or delete it.  This will force PHPmyadmin to access MYSQLCONNSTR_localdb and connect to the MySQL in-app server. mysqlinapp-connectionstring

2. My application cannot connect to MySQL in-app database

If your web app is unable to connect to MySQL in-app database, it could result from : To make your app resilient, use environment variables as shown here.

3. I cannot import my database with PHPmyadmin

PHPmyadmin allows your to import a database , but this  may fail due to: Note: When using mysqlimport.exe via Kudu debug console , the browser session timesout after 10 mins. If you have a large file then add the app setting SCM_COMMAND_IDLE_TIMEOUT=3600 for your web app prior to running mysqlimport.exe.

4. I cannot write to the database  OR I cannot create a comment or post on WordPress application

Turn on PHP error logs and if the error log states that the "InnoDB is in read only mode". This means file server storage is in READ ONLY mode , note that the file server is shared by your web app and MySQL database. The file server can be in read only mode due to

It is recommended to code your application to detect if the storage is in read only mode when using MySQL in-app. This can be done using a simple check to see if the folder wwwroot is writable using is_writable() in PHP before executing any INSERT / UPDATE / DELETE /CREATE Sql queries in your application.

5. How can I change MySQL server configuration

Click on your web app -> application setting , under app settings add the Key/Value pair , for example to increase max allowed packet to 16MB WEBSITE_MYSQL_ARGUMENTS = --max_allowed_packet=16M appsetting_mysql_arguments  

Additional References

Troubleshooting Wiki
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - old_posts/2016-9-8-Troubleshooting FAQ for MySQL in-app.html [3:93]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - hide_excerpt: true ---
mksunitha
Here are some troubleshooting guidelines for MySQL in-app feature:

1. I cannot to access the database using Phpmyadmin

When you access PHPmyadmin for MySQL in-app and the page returns a login page or “cannot connect: invalid settings” error. There can be two causes for this issue: Check process explorer if MySQL is running for your web app. You can access the process explorer in the portal. Select your web app -> Tools -> Process explorer processexploreremysql There will be mysqld.exe process visible in the process explorer. If the process mysqld.exe is not visible in the process explorer, then browse the web app or ping your web app which would trigger mysqld.exe process to run. Check process explorer again to verify that mysql process is running and browse phpmyadmin. With MySQL in-app we already preconfigure and setup PHPmyadmin. If you install PHPmyadmin from Site extensions gallery, then you will end up having two instances of PHPmyadmin. To identify if you have two instances both the conditions below will be true:
  1. PHPmyadmin folder exists in D:\home\siteextensions folder
  2. web app is using MySQL in-app feature
To resolve this, remove the site extension. Access the site extension gallery and click on remove button. Restart your web app and access your database with PHPmyadmin . Check in your web app application settings if there is a connection string. PHPmyadmin uses MYSQLCONNSTR_ to connect to the MySQL server. If you have a connection string in application setting change the connection string  type to Custom , so you can still have the information if needed or delete it.  This will force PHPmyadmin to access MYSQLCONNSTR_localdb and connect to the MySQL in-app server. mysqlinapp-connectionstring

2. My application cannot connect to MySQL in-app database

If your web app is unable to connect to MySQL in-app database, it could result from : To make your app resilient, use environment variables as shown here.

3. I cannot import my database with PHPmyadmin

PHPmyadmin allows your to import a database , but this  may fail due to: Note: When using mysqlimport.exe via Kudu debug console , the browser session timesout after 10 mins. If you have a large file then add the app setting SCM_COMMAND_IDLE_TIMEOUT=3600 for your web app prior to running mysqlimport.exe.

4. I cannot write to the database  OR I cannot create a comment or post on WordPress application

Turn on PHP error logs and if the error log states that the "InnoDB is in read only mode". This means file server storage is in READ ONLY mode , note that the file server is shared by your web app and MySQL database. The file server can be in read only mode due to

It is recommended to code your application to detect if the storage is in read only mode when using MySQL in-app. This can be done using a simple check to see if the folder wwwroot is writable using is_writable() in PHP before executing any INSERT / UPDATE / DELETE /CREATE Sql queries in your application.

5. How can I change MySQL server configuration

Click on your web app -> application setting , under app settings add the Key/Value pair , for example to increase max allowed packet to 16MB WEBSITE_MYSQL_ARGUMENTS = --max_allowed_packet=16M appsetting_mysql_arguments  

Additional References

Troubleshooting Wiki
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -