Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

ClaytonJames on "Error establishing a database connection"

$
0
0

Maybe one of you could give me the whole process of correctly making a database for wordpress,

If you've opted not to install phpMyAdmin - or if you're using the Ubuntu server distro (without a desktop GUI):

mysql -u root -p

CREATE DATABASE wordpress;

CREATE USER pete@localhost;

SET PASSWORD FOR pete@localhost= PASSWORD("iampete");

GRANT ALL PRIVILEGES ON wordpress.* TO pete@localhost IDENTIFIED BY 'iampete';

FLUSH PRIVILEGES;

In the above example my wordpress database name is "wordpress", the database username is "pete", and petes password is "iampete".

wp-config.php should look like this:

// ** 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', 'pete');

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

/** 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', '');

Add the security keys - you can generate random keys here - https://api.wordpress.org/secret-key/1.1/salt/ - refresh the page to generate random keys.

..and I think that should do it.

[edit] Some reference material that illustrates the process using several different database related tools: Step 2: Create the Database and a User


Viewing all articles
Browse latest Browse all 5527

Trending Articles