The easiest way to install them on Ubuntu is to use Ubuntu package manager, either command line:
Or inside System | Administration | Synaptic Package Manager, search for 'mysql-admin' and 'mysql-query', mark them for install, and then apply the changes.
After installation is complete, open a terminal and run command
I also tried installing the generic Linux tar bundle for MySql GUI tools, but had a couple of problems:
1. Download the generic Linux bundle (mysql-gui-tools-5.0r12-linux-i386.tar.gz) from http://dev.mysql.com/downloads/gui-tools/5.0.html . The bundle for Linux includes MySql Administrator and Query Browser (MySQL Migration Toolkit is currently only in Windows bundle).
2. To install the tools, just extract the archive. There are instructions at http://dev.mysql.com/doc/administrator/en/install-generic-tarball.html . Basically, execute this command to expand the downloaded file on Desktop to
3. To run MySql Administrator and Query Browser:
You may also want to copy/move/link
When running Query Browser, I ran into this issue: mysql-query-browser is freezing every way i try to pick, or click, a scheme. I tried removing everything under
It's possible to install to directories other than
I then chose to install directly under $HOME so that mysql-gui-tools-5.0/ and mysql/ are at the same level. I also ran mysql-administrator --update-paths to update the paths. I was able to run MySql Administrator, but the GUI fonts are sort of blurred, probably because some GTK library cannot be found. This problem was gone once I changed to the default install location /opt/mysql-gui-tools-5.0.
In addition, the update-paths command doesn't seem to update path for Query Browser, since MySQLQueryBrowser.desktop file still has paths under /opt.
Or inside System | Administration | Synaptic Package Manager, search for 'mysql-admin' and 'mysql-query', mark them for install, and then apply the changes.
After installation is complete, open a terminal and run command
mysql-admin
or mysql-query-browser
. If running them in an existing terminal, you may need to run rehash command first to include the new tools in PATH. Everything should just work.I also tried installing the generic Linux tar bundle for MySql GUI tools, but had a couple of problems:
1. Download the generic Linux bundle (mysql-gui-tools-5.0r12-linux-i386.tar.gz) from http://dev.mysql.com/downloads/gui-tools/5.0.html . The bundle for Linux includes MySql Administrator and Query Browser (MySQL Migration Toolkit is currently only in Windows bundle).
2. To install the tools, just extract the archive. There are instructions at http://dev.mysql.com/doc/administrator/en/install-generic-tarball.html . Basically, execute this command to expand the downloaded file on Desktop to
/opt
:3. To run MySql Administrator and Query Browser:
You may also want to copy/move/link
MySQLAdministrator.desktop
and MySQLQueryBrowser.desktop
to $HOME/Desktop
, so you can double-click to launch them.When running Query Browser, I ran into this issue: mysql-query-browser is freezing every way i try to pick, or click, a scheme. I tried removing everything under
$HOME/.mysqlgui/
but still the same.It's possible to install to directories other than
/opt
, but it may cause various troubles. I'd suggest stick to the default install directory /opt
. I first tried to install under $HOME/mysql
directory, to group all mysql-related programs under one umbrella. But I had this error when running ./mysql-administrator --update-paths:
I then chose to install directly under $HOME so that mysql-gui-tools-5.0/ and mysql/ are at the same level. I also ran mysql-administrator --update-paths to update the paths. I was able to run MySql Administrator, but the GUI fonts are sort of blurred, probably because some GTK library cannot be found. This problem was gone once I changed to the default install location /opt/mysql-gui-tools-5.0.
In addition, the update-paths command doesn't seem to update path for Query Browser, since MySQLQueryBrowser.desktop file still has paths under /opt.
We will use official MySQL Yum software repository, which will provides RPM packages for installing the latest version of MySQL server, client, MySQL Utilities, MySQL Workbench, Connector/ODBC, and Connector/Python for the RHEL/CentOS 7/6/ and Fedora 28-26. For FC5 and SuSE the gtkmm24 toolkit is a requirement for installing the RPM version of MySQL GUI Tools. You may also need to install the widget for.
Related
Managed MySQL, Redis, Postgres on DigitalOcean Product
How To Change Redis's Configuration from the Command Line Tutorial
Introduction
MySQL is an open-source database management system, commonly installed as part of the popular LEMP (Linux, Nginx, MySQL/MariaDB, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.
CentOS 7 prefers MariaDB, a fork of MySQL managed by the original MySQL developers and designed as a replacement for MySQL. If you run
yum install mysql
on CentOS 7, it is MariaDB that is installed rather than MySQL. If you’re wondering about MySQL vs. MariaDB, MariaDB will generally work seamlessly in place of MySQL, so unless you have a specific use-case for MySQL, see the How To Install MariaDB on Centos 7 guide.This tutorial will explain how to install MySQL version 5.7 on a CentOS 7 server.
Prerequisites
To follow this tutorial, you will need:
- A CentOS 7 with a non-root user with
sudo
privileges. You can learn more about how to set up a user with these privileges in the Initial Server Setup with CentOS 7 guide.
Step 1 — Installing MySQL
As mentioned in the introduction, the Yum command to install MySQL in fact installs MariaDB. To install MySQL, we’ll need to visit the MySQL community Yum Repository which provides packages for MySQL.
In a web browser, visit:
Note that the prominent Download links don’t lead directly to the files. Instead, they lead to a subsequent page where you’re invited to log in or sign up for an account. If you don’t want to create an account, you can locate the text “No thanks, just start my download”, then right-click and copy the link location, or you can edit the version number in the commands below.
Locate the desired version, and update it as needed in the link below:
Once the rpm file is saved, we will verify the integrity of the download by running
md5sum
and comparing it with the corresponding MD5 value listed on the site:Compare this output with the appropriate MD5 value on the site:
Now that we’ve verified that the file wasn’t corrupted or changed, we’ll install the package:
This adds two new MySQL yum repositories, and we can now use them to install MySQL server:
Press
y
to confirm that you want to proceed. Since we’ve just added the package, we’ll also be prompted to accept its GPG key. Press y
to download it and complete the install.Step 2 — Starting MySQL
We’ll start the daemon with the following command:
systemctl
doesn’t display the outcome of all service management commands, so to be sure we succeeded, we’ll use the following command:If MySQL has successfully started, the output should contain
Active: active (running)
and the final line should look something like:Note: MySQL is automatically enabled to start at boot when it is installed. You can change that default behavior with
sudo systemctl disable mysqld
During the installation process, a temporary password is generated for the MySQL root user. Locate it in the
mysqld.log
with this command:Make note of the password, which you will need in the next step to secure the installation and where you will be forced to change it. The default password policy requires 12 characters, with at least one uppercase letter, one lowercase letter, one number and one special character.
Step 3 — Configuring MySQL
MySQL includes a security script to change some of the less secure default options for things like remote root logins and sample users.
Use this command to run the security script.
This will prompt you for the default root password. As soon as you enter it, you will be required to change it.
Enter a new 12-character password that contains at least one uppercase letter, one lowercase letter, one number and one special character. Re-enter it when prompted.
You’ll receive feedback on the strength of your new password, and then you’ll be immediately prompted to change it again. Since you just did, you can confidently say
No
:After we decline the prompt to change the password again, we’ll press
Y
and then ENTER
to all the subsequent questions in order to remove anonymous users, disallow remote root login, remove the test database and access to it, and reload the privilege tables.Now that we’ve secured the installation, let’s test it.
Step 4 — Testing MySQL
We can verify our installation and get information about it by connecting with the
mysqladmin
tool, a client that lets you run administrative commands. Use the following command to connect to MySQL as root (-u root
), prompt for a password (-p
), and return the version.You should see output similar to this:
This indicates your installation has been successful.
Conclusion
In this tutorial, we’ve installed and secured MySQL on a CentOS 7 server. To learn more about using MySQL, this guide to learning more about MySQL commands can help. You might also consider implementing some additional security measures.