You will want to make sure that the quote in your command is not a "curly quote", like the ones in the command you shared; ’
and '
mean different things.
However, you can simplify this for yourself by skipping the three sed
commands they suggest and just opening the file for editing, which they ask you to do anyway:
sudo -u www-data nano /srv/www/wordpress/wp-config.php
In the file, you can replace database_name_here
with your proper database name, username_here
with the MySQL account name, and password_here
with the MySQL account password. Remember that you cannot use root
as the account name, so a proper WordPress-specific account will be needed.
In the event you need to configure these in MySQL, you can do this:
- Connect to MySQL as an administrator. For example:
sudo mysql
- Create the database if it does not already exist:
CREATE DATABASE `words` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- Create a user account that WordPress can use:
CREATE USER 'wpress'@'localhost' IDENTIFIED WITH mysql_native_password BY 'superSecretPassword!123';
- Grant permissions to the WordPress database, including the ability to create new tables:
GRANT ALL ON `words`.* TO 'wpress'@'localhost';
Be sure to replace the name of the database, the user account, and the password with ones that you would prefer. These values should match the values in your wp-config.php
file.