Ubuntu 18.04 mysql root user stuff

Here’s how to get Wordpress going (or anything else that needs mysql) without phpmyadmin.

First, get rid of phpmyadmin if it was giving you trouble:

sudo -s
apt purge phpmyadmin

Then run this command to set up a root password for your mysql install. Be sure to remember this password.

mysql_secure_installation

Now you can go into mysql as root:

mysql -u root -p

And once you’re in there, you’ll have a mysql prompt. Type these commands exactly (or copy-paste them), replacing “secure password” with a password for your Wordpress account.

CREATE DATABASE wordpress;

GRANT ALL PRIVILEGES ON wordpress.* TO "wordpress"@"localhost" IDENTIFIED BY "securepassword";

FLUSH PRIVILEGES;

There you go. Now you have sql user ‘wordpress’ with access to database ‘wordpress’ with password ‘securepassword’.

You can now exit mysql and install wordpress

exit