badx
Posts: 1
Joined: Sat May 19, 2018 4:15 pm
Location: USA, GA
Contact: Website

Set up your WordPress Database

Sat May 19, 2018 4:21 pm

When I "sudo mysql_secure_installation"
I get: sudo: mysql_secure_installation: command not found
What should I do?
Everything else went fine

ghellquist
Posts: 68
Joined: Thu Aug 02, 2012 8:47 am
Location: Stockholm Sweden

Re: Set up your WordPress Database

Sun May 20, 2018 8:10 am

It helps if you include a link to the instructions your are following, or even better, copy them in you question. The databas mysql is used to store information used by the wordpress code. There is nothing special about that installation, but there are a number of steps you need to follow. It might be that some of these steps are in the mysql_secure_installation which you referr to, and I have never heard of before ( which might say more about my ignorance than anything else ).

fbe
Posts: 537
Joined: Thu Aug 17, 2017 9:08 pm

Re: Set up your WordPress Database

Sun May 20, 2018 7:12 pm

badx wrote:
Sat May 19, 2018 4:21 pm
When I "sudo mysql_secure_installation"
I get: sudo: mysql_secure_installation: command not found
What should I do?
Everything else went fine
If everything else went fine, there's nothing to do.
If you use Raspbian Stretch and

Code: Select all

sudo mysql_secure_installation
gives you the error message

Code: Select all

sudo: mysql_secure_installation: command not found
then you still didn't install mariadb-server. Otherwise you would find it in /usr/bin.

To install WordPress, you could follow this tutorial https://projects.raspberrypi.org/en/pro ... -wordpress up to "Install PHP".

Page "Install MySQL" should now be titled "Install MariaDB".

Code: Select all

sudo apt-get install mariadb-server php-mysql -y
mysql-server is still accepted but mariadb-server is installed anyway. Then restart Apache.

The page "Download WordPress" is working as described.

The "Set up your WordPress Database" page is outdated and misleading. Don't run mysql_secure_installation! The Debian installation of MariaDB doesn't create anonymous or remote root users or test databases, so there's nothing to remove, and the created database root users password is ignored.

Simply type

Code: Select all

sudo mysql
to login as root to your local MariaDB server.
Then create your wordpress database and an user with all privileges for this database (replace secret with a strong password).

Code: Select all

create database wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO [email protected] IDENTIFIED BY  'secret';
exit;
It is not needed to grant privileges on wordpress to the database root user. He is Chuck Norris. He already has all of them.
It is not needed to flush privileges, if you used SQL GRANT statements.

On the next page "WordPress configuration" use wpadmin (and your password for wpadmin) instead of root.

Return to “General discussion”