It is possible to administer MySQL Server entirely from its command line client.
But you probably noticed that the MySQL command-line client is a lot of work, and rather cumbersome to boot. Remembering the syntax is something of a challenge, and occasionally even veteran database administrators have a hard time working through complex SQL statements. Sometimes the GUI is in fact quicker and easier. MySQL administration is often one of those cases.
Fortunately, MySQL has a GUI available, a program called phpMyAdmin. It’s a web interface, which means that you connect to it via a web browser from another computer. It runs off the PHP scripting language, and lets you quickly and efficiently make changes to your MySQL Server. It even lets you enter command-line SQL statements, if you prefer.
Obviously, you will need MySQL Server installed before you can install phpMyAdmin. Once you have MySQL installed, you’re ready to begin.
To install phpMyAdmin, go to a Terminal window or command prompt and type this command:
sudo apt-get install phpmyadmin
This will download and install phpMyAdmin on your Ubuntu system. The phpMyAdmin package comes with quite a lot of dependencies, so the downloading and installation might take some time.
Once the package starts installing, it will ask you whether or not you want to use Apache or lighttpd for phpMyAdmin’s web server. Generally, unless you have a good reason to do otherwise, I’d recommend that you use Apache. (You can use the tab key to move the cursor while within the dialog box, if you get stuck.)
Next, the installer will ask if it can create and configure a database for phpMyAdmin using the dbconfig-common script. If you’re a first-time user, and don’t have advanced configuration needs, then use the tab key to select Yes and hit enter. The script will ask you for the password of your MySQL server’s root user. Enter the password, and the installer will continue.
The installer will then ask for a password for phpMyAdmin’s database user. Select a password for the database user. Remember, as always, to set a strong password, with a mixture of uppercase letters, lowercase letters, numerals, and punctuation. You’ll then need to enter the password again.
After that, the installer will wrap up and return you to the command line. If you installed it locally, you can then access your new phpMyAdmin installation by opening up a web browser on your Ubuntu system and navigating to this address:
Enter your MySQL root user and password, and you’ll have access to phpMyAdmin.
You can also access phpMyAdmin from a remote computer. For instance, if you installed phpMyAdmin on the machine with the IP address of 192.168.1.100, you would access it with this address:
Was this post helpful? These books might be useful: