Not everyone will enjoy management of a database server from the command line interface. As a developer you need a faster way to move from development to Production, with less hassle and sometimes command line interfaces is not an option. One of the mostly used tools for database management – creating databases, users, starting and stopping services, importing and exporting databases is MySQL Workbench. In this short tutorial I’ll show you the steps you need to follow to install and start using MySQL Workbench on CentOS 8 Workstation.
MySQL Workbench is a graphical user interface tool created by MySQL development team behind the powerful MySQL RDMS. This tools is created for both Developers and Database administrators. It is a handy tool for general administration and maintenance of MySQL database systems. It can also be used for MariaDB databases – fork of MySQL. Before you begin installation, it is worth taking note of available MySQL Workbench editions.
- MySQL Workbench Community Edition
- MySQL Workbench Standard Edition
- MySQL Workbench Enterprise Edition
It is recommended you review your business requirements, team size before choosing an edition to go with. As this guide is created for home users, we’ll be helping you with the installation of the MySQL Workbench Community Edition in your CentOS 8 Desktop. I expect you to have a working CentOS 8 OS with graphical interface as this tool is for Desktop and not Server operating systems. It could be possible to run it through an SSH X session but this has not been tested.
Some key features that you’ll get from MySQL Workbench Community Edition are:
- User and Session Management: Manage application roles, users and sessions from graphical interface.
- Visual SQL Development: You’ll get SQL Code Editor, Completion, Formatter, Syntax Highlighting, Code Generation, Snippets, and use of history.
- Data Management: Import and export, Quickly locate hard to find rows or cells and table Data Search.
- Visual Database Administration: You’ll be able to Stop/Start servers locally and remotely, View key server diagnostic information, View and parse slow and error logs, view and edit server settings, View and edit MySQL Replication settings.
- Connection Management: Configure connections to MySQL Servers and Configure SSH connections to local and remote servers.
- Visual Data Modeling: Auto Layout, Model Stored Procedures, Triggers, Functions, Model User Security and Auto Layout.
- Schema Synchronization
- Reverse Engineering from SQL Script and from Live Database.
Install MySQL Workbench on CentOS 8
The next sections will demonstrate step-by-step installation of MySQL Workbench on CentOS 8 Desktop machine. If you have not done a recent update of your operating system I’ll recommend you fire commands below in your terminal to make sure you’re rolling on latest OS updates.
sudo dnf -y update sudo systemctl reboot
Add MySQL Repository to CentOS 8
Wait for the system to be started if you performed an upgrade as guided in previous step. Once the system comes up, add MySQL YUM repository which is officially created and maintained by MySQL development team.
You can download the repository installation rpm file and run it locally or install from the URL with dnf command. I prefer the latter for ease of use.
sudo dnf -y install https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
RPM package details can be viewed with the rpm command line tool.
$ rpm -qi mysql80-community-release Name : mysql80-community-release Version : el8 Release : 1 Architecture: noarch Install Date: Sun 26 Jul 2020 02:04:57 AM EAT Group : System Environment/Base Size : 29869 License : GPLv2 Signature : DSA/SHA1, Fri 04 Oct 2019 10:30:12 AM EAT, Key ID 8c718d3b5072e1f5 Source RPM : mysql80-community-release-el8-1.src.rpm Build Date : Fri 04 Oct 2019 10:25:00 AM EAT Build Host : viking75.no.oracle.com Relocations : (not relocatable) Packager : MySQL Release Engineering <[email protected]> Vendor : MySQL URL : http://dev.mysql.com Summary : MySQL repository configuration for yum Description : Package for installation of setup/configuration files required for installation of MySQL packages by yum.
If you check repository files directly you should see a new file written by the installer package.
$ ls /etc/yum.repos.d/mysql-community* /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo
Install MySQL Workbench on CentOS 8
The repository for MySQL is enabled by default and no further action is required before using it.
$ cat /etc/yum.repos.d/mysql-community.repo [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/8/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-connectors-community] name=MySQL Connectors Community baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/8/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-community] name=MySQL Tools Community baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/8/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-preview] name=MySQL Tools Preview baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/8/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-8.0-community] name=MySQL Cluster 8.0 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/8/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Update YUM package index.
$ sudo dnf makecache timer CentOS-8 - AppStream 2.2 kB/s | 4.3 kB 00:01 CentOS-8 - Base 8.6 kB/s | 3.9 kB 00:00 CentOS-8 - Extras 2.2 kB/s | 1.5 kB 00:00 Extra Packages for Enterprise Linux Modular 8 - x86_64 30 kB/s | 61 kB 00:02 Extra Packages for Enterprise Linux 8 - x86_64 39 kB/s | 61 kB 00:01 MySQL 8.0 Community Server 350 kB/s | 919 kB 00:02 MySQL Connectors Community 19 kB/s | 33 kB 00:01 MySQL Tools Community 91 kB/s | 109 kB 00:01 Metadata cache created.
You can then run the command to install MySQL Workbench tool on CentOS 8:
sudo dnf install mysql-workbench-community
On executing the command above you’ll be asked to confirm package installation by pressing y or Y key.
Dependencies resolved. ===================================================================================================================================================================================================== Package Architecture Version Repository Size ===================================================================================================================================================================================================== Installing: mysql-workbench-community x86_64 8.0.21-1.el8 mysql-tools-community 33 M Installing dependencies: libzip x86_64 1.5.1-2.module_el8.2.0+313+b04d0a66 AppStream 62 k mesa-libGLU x86_64 9.0.0-15.el8 AppStream 185 k pcre-cpp x86_64 8.42-4.el8 BaseOS 47 k Enabling module streams: httpd 2.4 nginx 1.14 php 7.2 Transaction Summary ===================================================================================================================================================================================================== Install 4 Packages Total download size: 33 M Installed size: 186 M Is this ok [y/N]: y
The package to be downloaded is around 33M and this should be quick if you have moderate speed internet connection.
Make sure you import GPG key during installation. If you happen to hit the n key installation will be aborted.
Total 585 kB/s | 33 MB 00:58 warning: /var/cache/dnf/mysql-tools-community-9c88dbf3370d24b7/packages/mysql-workbench-community-8.0.21-1.el8.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY MySQL Tools Community 27 MB/s | 27 kB 00:00 Importing GPG key 0x5072E1F5: Userid : "MySQL Release Engineering <[email protected]>" Fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Is this ok [y/N]: y
Using MySQL Workbench on CentOS 8
Once installation is confirmed to have finished without errors MySQL Workbench application can be launched from DE launcher by typing “MySQL” keyword and selecting from the list.
You’ll get welcome page for MySQL Workbench. This confirms installation was successful and application can run.
Click on Database > Connect to Database to create first connection to a database server.
Provide Database server hostname or IP, port number and password for connection. Use “Store in Keychain” for password.
Confirm the connection is working by clicking on “Server Status” to check server details.
You have MySQL Workbench installed and working on CentOS 8 Desktop machine. The next stage is to go through documentation pages to understand how MySQL Workbench works and how you can use it for faster development. You can also check below MySQL course to up your skills on Database administration.
Best Udemy Video Courses to Learn MySQL / MariaDB Databases:
- The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert
- SQL for Beginners: Learn SQL using MySQL and Database Design
- The Complete MySQL Developer Course
- MySQL Database Administration: Beginner SQL Database Design
- Learn Database Design with MySQL
For installation on Ubuntu use below link.