Create a New MySQL Database and User
Once you’ve installed MySQL server software, you’re ready to create your first database and user for that database.
Create A New MySQL Database & User
SSH into the web server with an SSH key pair:
ssh -i ~/.ssh/supernifty supernifty@143.198.116.106 RETURN
Begin a new MySQL session. If you enter the command above (‘sudo mysql‘ vs just ‘mysql‘), mysql won’t challenge you for the mysql root user password:
sudo mysql RETURN
Create a new MySQL database (eg: ’25MonkeysWP’):
create database 25MonkeysWP; RETURN
Create a new MySQL user. In this example, the user is ‘superniftyWPUser01’ with a password set to ‘pB4$bJ8m3#BfS2Q0&vX’:
create user ’25MonkeysWPDBUser’@’%’ identified by ‘f6xtd05%85da#c7cd3#b6^5’; RETURN
(Note that if you set the MySQL password strength requirements really high when you set up the MySQL server, the password in this example might not be strong enough.)
Now there is a new MySQL user, but that user doesn’t have permission to work on anything yet. The next step is to grant all privileges (create, edit, delete) to the MySQL user ‘25MonkeysWPDBUser‘ to all of data contained in the ‘25MonkeysWP‘ database:
grant all privileges on 25MonkeysWP.* TO ’25MonkeysWPDBUser’@’%’; RETURN
Flush (or refresh) all privileges/permissions so that the changes will take effect:
flush privileges; RETURN
Enter the exit command to end the current MySQL session and return to the standard command prompt:
exit RETURN
To end the SSH session and completely disconnect from the server, enter the exit command again:
exit RETURN
With the new empty MySQL database set up and the new database user ready to go, it’s time to install PHP 8.0 to run WordPress.