On Fedora 25, I want to develop a Wordpress website. Here's a summary of what I did, but I still cannot get it to work and enter Wordpress management panel:
1- I started MySQL by running
sudo systemctl start mariadb
2- I started Apache by running
sudo systemctl start httpd
3- I unzipped Wordpress 4.7.4 to
/var/www/html. I also changed the ownership of the wordpress folder to
4- I created a database in mysql:
CREATE DATABASE mydb
CHARACTER SET = UTF16
COLLATE = utf16_persian_ci
5- I added a database user:
CREATE USER 'john'@'localhost' IDENTIFIED BY 'P@ssw0rd'
6- I created wp-config.php inside the wordpress folder by
cp wp-config-sample.php wp-config.php and edited it as follows:
define('DB_NAME', 'mydb'); /** MySQL database username */ define('DB_USER', 'john'); /** MySQL database password */ define('DB_PASSWORD', 'P@ssw0rd'); /** 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', 'utf16_persian_ci');
Now when I open
http://localhost/wordpress in my browser, I see a big "Error establishing a database connection".
When I open
http://localhost/wordpress/wp-admin an error page appears saying:
We were able to connect to the database server (which means your username and password is okay) but not able to select the mydb database.
I do not know what I did wrong. I am user the database exists, but have no idea why Wordpress cannot connect to it.