0

I'm attempting to complete a beginner's project from raspberrypi.org's projects page. However, after following the project directions I keep receiving an "error establishing a database connection" message. I would appreciate any hints on how to correct this.

Here is the project page

I have created a wp-config.php file with the following information:

host=localhost
username=root
database name=wordpress
table prefix=wp_
password=(the one I created when installing MYSQL)

My hope is that there is something obvious about the interaction between Wordpress and the database that I'm overlooking and can correct. Most people describing the project online say it is fairly straightforward.

One possible issue that may be interfering: I use a laptop with Ubuntu 18.04 LTS as the monitor for my pi, connecting using VNC Viewer.

Here is the wp-config.php file.

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );

/** MySQL database username */
define( 'DB_USER', 'root' );

/** MySQL database password */
define( 'DB_PASSWORD', 'XXXX' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define( 'AUTH_KEY',         'put your unique phrase here' );
define( 'SECURE_AUTH_KEY',  'put your unique phrase here' );
define( 'LOGGED_IN_KEY',    'put your unique phrase here' );
define( 'NONCE_KEY',        'put your unique phrase here' );
define( 'AUTH_SALT',        'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT',   'put your unique phrase here' );
define( 'NONCE_SALT',       'put your unique phrase here' );

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define( 'WP_DEBUG', false );

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}

/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );
Aurora0001
  • 6,308
  • 3
  • 23
  • 38
snowka
  • 1
  • 2
  • I have created a wp-config.php file - please show the file exactly as you have created it – Jaromanda X Jul 28 '19 at 03:37
  • You haven't told us what OS you are using. The Foundation tutorial are a bit out of date, but I don't recollect any suggesting you "created a wp-config.php file". Unless you explain what YOU did this is just a rant. – Milliways Jul 28 '19 at 03:44
  • Glad to share more information. The OS is Raspbian GNU/Linux 9 (Stretch). I include the wp-config.php file below. – snowka Jul 28 '19 at 13:39
  • Regarding the creation of the wp-config.php file: I received a database connection error when entering the information for this using the Wordpress web form using the tutorial instructions; Wordpress's page suggests that if this fails one should create the wp-config.php file manually and enter the information directly. – snowka Jul 28 '19 at 13:42
  • Correction: the wp-config.php file was added to the original post above. – snowka Jul 28 '19 at 13:50

0 Answers0