GoAdmio

phpmyadmin

Install phpMyAdmin with a cookie-based single sign-on bridge, or grant a hosted domain's MySQL user access to its own databases

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/phpmyadmin does two unrelated things, chosen by how you call it:

  1. With no arguments, or with --install anywhere in the arguments — (re)installs phpMyAdmin itself from the official tarball, patched to auto-log in using two browser cookies instead of phpMyAdmin's normal login form.
  2. With a domain name, or all — grants that domain's (or every domain's) MySQL user ALL PRIVILEGES on its own databases. This does not touch the phpMyAdmin software at all.

[!WARNING] The same first argument ($1) means different things depending on how it's used: a phpMyAdmin version when installing, a domain name otherwise. /go/phpmyadmin 5.2.4 alone (no --install) is read as a request to grant privileges to a domain literally named 5.2.4, not as "install version 5.2.4". To install a specific version, you must include --install as well: /go/phpmyadmin 5.2.4 --install.

The command re-runs itself with sudo when started by a non-root user. The call is appended to /var/log/go/phpmyadmin.log.


Quick start

# Install phpMyAdmin (default version)
/go/phpmyadmin

# Grant one domain's MySQL user access to its databases
/go/phpmyadmin example.com

# Grant every hosted domain
/go/phpmyadmin all

Syntax

/go/phpmyadmin
/go/phpmyadmin <version> --install
/go/phpmyadmin <domain>
/go/phpmyadmin all
Form Behavior
/go/phpmyadmin Installs the default version (currently 5.2.3).
/go/phpmyadmin <version> --install Installs that specific version instead.
/go/phpmyadmin <domain> Grants ALL PRIVILEGES on that domain's own databases to a MySQL user named after the domain.
/go/phpmyadmin all Runs the single-domain grant for every account with a www folder.

Before installing, the command refuses to run if the server has less than 512 MB of total RAM.


Options

Argument Notes
<version> A phpMyAdmin release number matching a tarball at files.phpmyadmin.net. Only takes effect together with --install.
--install Forces install mode, whatever else is on the command line.
<domain> A hosted domain, to grant privileges for.
all Grants privileges for every hosted domain, one after another.

Output

Install mode shows a progress indicator ("Installing phpMyAdmin <version>") followed by curl/tar/mariadb output. Privilege-granting mode prints nothing on success.


Examples

# Install the default version
/go/phpmyadmin
# Install a specific version
/go/phpmyadmin 5.2.4 --install
# Grant one domain
/go/phpmyadmin example.com
# Grant every domain
/go/phpmyadmin all

Troubleshooting

Symptom Likely cause Fix
phpMyAdmin requires at least 0.5 GB of RAM to install. The server has less than 512 MB of total installed RAM (not current free memory). Use a server with more RAM, or install phpMyAdmin manually if you understand the trade-offs.
A version number you passed was silently ignored, and nothing seemed to install It was read as a domain name, not a version, because --install wasn't included. Add --install: /go/phpmyadmin <version> --install.
phpMyAdmin is missing entirely after trying to reinstall it The existing install is deleted before the new download is confirmed; a failed or interrupted download leaves nothing in its place. Check your network access to files.phpmyadmin.net, confirm the version number exists as a release, and run the command again.
phpMyAdmin logs you in automatically with the wrong account, or not at all The cookie-based login patch (see Details) wasn't applied — likely because the installed version's config.sample.inc.php doesn't match the exact text this command's sed looks for. Check config.inc.php for the CookiesMySQLUsername/CookiesMySQLPassword block; if it's missing, the patch silently didn't apply for that version.
A domain's database user can connect with no password at all That domain's Salt value in the Site table is empty, so the grant sets an empty password. Check select Domain, Salt from site.db where Domain='<domain>'; make sure every account has a non-empty Salt before relying on this.
The grant for a domain seems to do nothing, or targets a user that doesn't exist The command grants privileges to a MySQL user named exactly after the domain, which may not match the username convention your databases actually use (see mysql). Check which MySQL user actually owns the domain's databases, and grant privileges to that user directly if it differs.
Privilege granting fails with a MySQL username-length error for a long domain MySQL usernames are limited to 32 characters; a domain name longer than that can't be used as a username at all. Shorten the target username, or grant privileges manually for that account.

Details

Installing (no arguments, or --install)

  1. Deletes any existing install at /usr/local/goadmio/home/go/phpmyadmin.
  2. Downloads phpMyAdmin-<version>-all-languages.tar.gz from files.phpmyadmin.net over HTTPS, with no checksum or signature check against phpMyAdmin's own published hashes.
  3. Extracts it, renames the extracted folder to phpmyadmin, and copies config.sample.inc.php to config.inc.php.
  4. Creates a world-writable (777) tmp folder inside it, which phpMyAdmin needs for uploads and imports.
  5. Patches config.inc.php, replacing the default host line with a block that reads a MySQL username and password straight from two cookies (CookiesMySQLUsername, CookiesMySQLPassword) and logs in as that user automatically if the cookies are present — this is how GoAdmio's own panel likely gives a logged-in user one-click access to phpMyAdmin without a separate login step.
  6. Writes a logout.php that clears both cookies and redirects back to the login page.
  7. Creates the phpmyadmin configuration-storage database and imports its tables from sql/create_tables.sql.
  8. Grants root@localhost full privileges on everything and reaffirms its password — a side effect bundled into the install step, not obviously related to phpMyAdmin itself.

Granting privileges (a domain, or all)

For the named domain, every database registered to it in mysql.db is granted ALL PRIVILEGES to a MySQL user named exactly after the domain, authenticated with the domain's stored Salt value as the password. all repeats this for every hosted account.

Known issues


See also

Command Description
mysql Create a MySQL database
mysqlreset Change the MySQL root password in safe mode
mysqlset Change the MySQL root password
installmariadb Install or update MariaDB to the latest version
ffmpeg Rebuild ImageMagick from source and install FFmpeg from the Nux Dextop repository — CentOS 7 (EL7) only
installgo Install a pinned Go release on the RHEL family from the official tarball — on Debian and Ubuntu, this only repairs a broken dpkg state and does not install Go