Menu
ELECTRONgeek
ELECTRONgeek

Azure MySQL In-App Configuration for PHP Content Management Systems

Posted on December 9, 2016February 28, 2019 by egeek

Content Management Systems such as WordPress, Drupal, Joomla contain the database credentials within a configuration file. If you decide to use MySQL In-App for development purposes, you will quickly realize that you need to modify these credentials to work with MySQL In-App.

Below is a table containing the default configuration, followed by In-App credentials and configuration. To update your configuration with MySQL In-App, copy-paste both Part 1 and Part 2 for your respective CMS.


WordPress 4+

Joomla 3+

Drupal 8+
Configuration Location
wwwroot/wp-config.php

wwwroot/configuration.php

wwwroot/sites/default/settings.php

Default Configuration

/** The name of the database for WordPress */
define(‘DB_NAME’, ‘databaseName’);/** MySQL database username */
define(‘DB_USER’, ‘databaseUserName’);/** MySQL database password */
define(‘DB_PASSWORD’, ‘databasePassword’);/** MySQL hostname */
define(‘DB_HOST’, ‘databaseHostName’);

public $dbtype = ‘mysql’;
public $host = ‘databaseHostName’;
public $user = ‘databaseUserName’;
public $password = ‘databasePassword’;
public $db = ‘databaseName’;
public $dbprefix = ‘jos_’;

$databases[‘default’][‘default’] = array (
‘database’ => ‘databasename’,
‘username’ => ‘sqlusername’,
‘password’ => ‘sqlpassword’,
‘host’ => ‘localhost’,
‘port’ => ‘3306’,
‘driver’ => ‘mysql’,
‘prefix’ => ”,
‘collation’ => ‘utf8mb4_general_ci’,);

MySQL In-App
Connection String


// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, $connectstr_dbname);
/** MySQL database username */
define(‘DB_USER’, $connectstr_dbusername);
/** MySQL database password */
define(‘DB_PASSWORD’, $connectstr_dbpassword);
/** MySQL hostname : this contains the port number in this format host:port.
/** Port is not 3306 when using this feature*/
define(‘DB_HOST’, $connectstr_dbhost);

public $dbtype = ‘mysql’;
public $host = DB_HOST;
public $user = DB_USER;
public $password = DB_PASSWORD;
public $db = DB_NAME;
public $dbprefix = ‘jos_’;

$databases[‘default’][‘default’] = array (
‘database’ => $connectstr_dbname,
‘username’ => $connectstr_dbusername,
‘password’ => $connectstr_dbpassword,
‘prefix’ => ”,
‘host’ => $connectstr_dbhost,
‘port’ => $_SERVER[‘WEBSITE_MYSQL_PORT’],
‘driver’ => ‘mysql’,
‘namespace’ => ‘Drupal\\Core\\Database\\Driver\\mysql’,
‘collation’ => ‘utf8mb4_general_ci’,
);

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Using MySQL In-App on Azure App Service
  • On-prem vs. IaaS vs. PaaS vs. SaaS
  • 1024 x 768 Display Resolution on External Monitor
  • WordPress MySQL Database options on Azure
  • 2019 Toddler Education

Archives

  • July 2020
  • June 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • February 2018
  • July 2017
  • June 2017
  • December 2016

Categories

  • app service
  • Azure
  • mysql in-app
  • Tech
  • Uncategorized
  • windows
  • Wordpress

Tags

1024x768 android app appinit application initialization app not installed app service assistant azure azure app service azure database for mysql configuration display resolution easy mysql import fun game git google play in-app kids microsoft microsoft windows 10 migration mysql mysql in-app password performance php cms plugin repo site extension subsystem linux toddler education virtual machines windows wordpress wordpress buddy wordpress redirection xamarin
©2022 ELECTRONgeek | WordPress Theme by Superb Themes