Category Archives: phpMyAdmin

Admin skull folder

Change your WordPress SuperAdmin User Name for WordPress Multisite

If you are using a Bitnami WordPress (multisite) stack like I am, then your /wp-admin/ login is going to be pre-set to “user”, which:

  • sucks as a name
  • make your login 50% easier to hack
  • can’t be changed in the web UI

If you wanted to login as a custom-named SuperAdmin, you could either

  1. make a new user and make them also a SuperAdmin when setting their role, OR
  2. rename “user” to your desired login

I chose going with route #2 because leaving a SuperAdmin with the login of “user” still leaves a security weakness.

Changing “user” login to “anotheruser” (for example)

admin-user

  1. Connect to your MySQL WordPress Database
  2. In phpMyAdmin, select your wordpress database (mine is named “bitnami_wordpress”)
  3. Navigate to your wp_users table.
    • There will be one row per user.
    • Edit the user_login column for “user” and change it to “anotheruser”
    • Save

Now, this would be ordinarily be enough to just rename your login, but you will lose your SuperAdmin access to your Network Admin if you don’t make one more change.

Making “anotheruser” SuperAdmin to be able to access Network Admin

admin-meta

    1. Count the number of characters in your new login name (eg “anotheruser” has 11 characters)
    2. Navigate to your wp_sitemeta table
    3. Edit the row with a meta-key of “site_admins” and change the meta_value from
      • “a:1:{i:0;s:4:”user“;}” to
      • “a:1:{i:0;s:11:”anotheruser“;}”
      • (the name part is quite obvious, but you also have to manually specify how many characters long the name is)
    4. For me, this change was applied automatically and instantly, but it couldn’t hurt to reboot your server and logout and log in again.
phpMyAdmin screenshot

Connecting to your WordPress Database with phpMyAdmin from an OSX Remote Machine

If you are using a Bitnami WordPress (multisite) stack like I am, your web-based database phpMyAdmin is setup by default to only be accessible if you are on the same machine (IP address of 127.0.0.1:80).

So in order to get access remotely, you have to trick your machine into thinking you are local.  Thankfully there is some documentation on how to do all of this… but the following is a succinct summary.

  1. Beforehand, setup your .pem keyfile in your keychain, or add -i path/to/your.pem in the following ssh command.
  2. In Terminal, type ssh -N -L 8888:127.0.0.1:80 bitnami@yourdomain.com
    • Unfortunately, when this command runs successfully, there is no text shown.. 
  3. In a web browser, go to http://127.0.0.1:8888/phpmyadmin/
  4. The default credentials for a Bitnami stack are “root” and a password of “bitnami”

When you are done, you can just kill your SSH connection with a Control-C.