Thumb 4 20  20working 20with 20mysql 20and 20phpmyadmin

#4 Wordpress One-click Install - Working With Mysql and Phpmyadmin

Category: Free

In sequel to Episode 3 "Wordpress One-click Install and Grabbing A Free Domain Name," we'll be taking a look into MySQL and installing PHPMyAdmin for GUI management.



MySQL

Let's take a quick look into the database behind your Wordpress installation.

First, you'll need your MySQL password:

cat .my.cnf

Then, you'll login to the MySQL console via:

mysql -u root -p

Notice the word "root." That is the username for you MySQL login. If you in the future you want to login with another username, be sure to change "root" to the valid username. It's always a good idea to make the root password extremely strong and then create another MySQL user for your applications to use. This helps as a precaution to malicious users getting access to your entire database structure.

Once inside MySQL, you can display all the databases via:

SHOW DATABASES;

You can create a database using the "create database ..." command. For example:

CREATE DATABASE sites_wp;

Notice that the words "create database" are in all upper case. This is just a best practice that helps you differentiate between the commands and the names of objects in the database.

Now, if you show the databases again, you should see your new database in the table.

SHOW DATABASES;

You can now start using that new database by using the "use" command:

USE sites_wp;

PHPMyAdmin

To install PHPMyAdmin, just run the following on your Ubuntu droplet:

sudo apt-get install -y phpmyadmin

Let's break the above command down real quick.

  • "sudo" - stands for superuser do. Or, to run this command as a super user.
  • "apt-get" - uses the APT package handling utility to grab the package you're going to install
  • "install" - command to install
  • "-y" - means to assume yes to all prompts. You can also use --yes or --assume-yes
  • "phpmyadmin" - the package for PHPMyAdmin

Once installed, add "/phpmyadmin" your domain name and login to PHPMyAdmin with your MySQL login.

What to Look Forward To

I'll follow up with an in depth video series on both MySQL and PHPMyAdmin in the future.

comments powered by Disqus