Dear Readers,
In this article, we will see the following MySQL Upgrade from 5.7 to 8.0
1. Logging to AWS Account
First, we need to AWS Console page by using below link.
https://aws.amazon.com/console/
Click on sign in to Console button.
Logging to aws account
Login using username & password and click on sign in.
Enter to AWS Management Console
We can see the AWS Management Console Dashboard.
Go to Services, under the compute module click EC2 service to open.
2. Launch MySQL Server
Go to Services, under the compute module click EC2 service to open.
We can launch Windows Server by using below link.
We can see the windows server has been launched successfully.
3. Connect to Linux EC2 Instance Using Putty
We can connect putty by using below link.
Connect to MySQL Server Using Putty
1 2 3 |
login as: ec2-user Authenticating with public key "imported-openssh-key" [ec2-user@ip-172-31-41-179 ~]$ |
4. Switch to root user
1 2 |
[ec2-user@ip-172-31-41-7 ~]$ sudo su [root@ip-172-31-41-7 ec2-user]# |
5. Install Server updates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
[root@ip-172-31-41-7 ec2-user]# yum update -y Red Hat Update Infrastructure 3 Client Configuration Server 8 14 kB/s | 3.5 kB 00:00 Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs) 39 MB/s | 25 MB 00:00 Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs) 43 MB/s | 26 MB 00:00 Dependencies resolved. ============================================================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================================================== Installing: kernel x86_64 4.18.0-240.8.1.el8_3 rhel-8-baseos-rhui-rpms 4.3 M kernel-core x86_64 4.18.0-240.8.1.el8_3 rhel-8-baseos-rhui-rpms 30 M kernel-modules x86_64 4.18.0-240.8.1.el8_3 rhel-8-baseos-rhui-rpms 26 M Upgrading: NetworkManager x86_64 1:1.26.0-12.el8_3 rhel-8-baseos-rhui-rpms 2.4 M NetworkManager-libnm x86_64 1:1.26.0-12.el8_3 rhel-8-baseos-rhui-rpms 1.8 M NetworkManager-team x86_64 1:1.26.0-12.el8_3 rhel-8-baseos-rhui-rpms 142 k NetworkManager-tui x86_64 1:1.26.0-12.el8_3 rhel-8-baseos-rhui-rpms 320 k cloud-init noarch 19.4-11.el8_3.1 rhel-8-appstream-rhui-rpms 945 k curl x86_64 7.61.1-14.el8_3.1 rhel-8-baseos-rhui-rpms 353 k freetype x86_64 2.9.1-4.el8_3.1 rhel-8-baseos-rhui-rpms 394 k gnutls x86_64 3.6.14-7.el8_3 rhel-8-baseos-rhui-rpms 1.0 M insights-client noarch 3.1.1-1.el8_3 rhel-8-appstream-rhui-rpms 1.0 M iptables-libs x86_64 1.8.4-15.el8_3.3 rhel-8-baseos-rhui-rpms 106 k kernel-tools x86_64 4.18.0-240.8.1.el8_3 rhel-8-baseos-rhui-rpms 4.5 M kernel-tools-libs x86_64 4.18.0-240.8.1.el8_3 rhel-8-baseos-rhui-rpms 4.3 M kexec-tools x86_64 2.0.20-34.el8_3.1 rhel-8-baseos-rhui-rpms 496 k libcurl x86_64 7.61.1-14.el8_3.1 rhel-8-baseos-rhui-rpms 299 k microcode_ctl x86_64 4:20200609-2.20201112.1.el8_3 rhel-8-baseos-rhui-rpms 4.6 M openssl x86_64 1:1.1.1g-12.el8_3 rhel-8-baseos-rhui-rpms 707 k openssl-libs x86_64 1:1.1.1g-12.el8_3 rhel-8-baseos-rhui-rpms 1.5 M python3-perf x86_64 4.18.0-240.8.1.el8_3 rhel-8-baseos-rhui-rpms 4.4 M qemu-guest-agent x86_64 15:4.2.0-34.module+el8.3.0+8829+e7a0a3ea.1 rhel-8-appstream-rhui-rpms 228 k systemd x86_64 239-41.el8_3.1 rhel-8-baseos-rhui-rpms 3.5 M systemd-libs x86_64 239-41.el8_3.1 rhel-8-baseos-rhui-rpms 1.1 M systemd-pam x86_64 239-41.el8_3.1 rhel-8-baseos-rhui-rpms 456 k systemd-udev x86_64 239-41.el8_3.1 rhel-8-baseos-rhui-rpms 1.3 M tuned noarch 2.14.0-3.el8_3.1 rhel-8-baseos-rhui-rpms 292 k Installing dependencies: linux-firmware noarch 20200619-101.git3890db36.el8_3 rhel-8-baseos-rhui-rpms 101 M Transaction Summary ============================================================================================================================================================================================================== Install 4 Packages Upgrade 24 Packages Total download size: 198 M Downloading Packages: (1/28): kernel-4.18.0-240.8.1.el8_3.x86_64.rpm 15 MB/s | 4.3 MB 00:00 (2/28): kernel-core-4.18.0-240.8.1.el8_3.x86_64.rpm 33 MB/s | 30 MB 00:00 (3/28): kernel-modules-4.18.0-240.8.1.el8_3.x86_64.rpm 22 MB/s | 26 MB 00:01 (4/28): cloud-init-19.4-11.el8_3.1.noarch.rpm 3.6 MB/s | 945 kB 00:00 (5/28): qemu-guest-agent-4.2.0-34.module+el8.3.0+8829+e7a0a3ea.1.x86_64.rpm 1.9 MB/s | 228 kB 00:00 (6/28): insights-client-3.1.1-1.el8_3.noarch.rpm 6.8 MB/s | 1.0 MB 00:00 (7/28): NetworkManager-team-1.26.0-12.el8_3.x86_64.rpm 1.3 MB/s | 142 kB 00:00 (8/28): freetype-2.9.1-4.el8_3.1.x86_64.rpm 3.1 MB/s | 394 kB 00:00 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 64 MB/s | 198 MB 00:03 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: systemd-libs-239-41.el8_3.1.x86_64 1/1 Upgrading : systemd-libs-239-41.el8_3.1.x86_64 1/52 Running scriptlet: systemd-libs-239-41.el8_3.1.x86_64 1/52 Upgrading : gnutls-3.6.14-7.el8_3.x86_64 2/52 Upgrading : openssl-libs-1:1.1.1g-12.el8_3.x86_64 3/52 Running scriptlet: openssl-libs-1:1.1.1g-12.el8_3.x86_64 3/52 Upgrading : libcurl-7.61.1-14.el8_3.1.x86_64 4/52 Upgrading : NetworkManager-libnm-1:1.26.0-12.el8_3.x86_64 5/52 Running scriptlet: NetworkManager-libnm-1:1.26.0-12.el8_3.x86_64 5/52 Upgrading : iptables-libs-1.8.4-15.el8_3.3.x86_64 6/52 Running scriptlet: systemd-239-41.el8_3.1.x86_64 7/52 Upgrading : systemd-239-41.el8_3.1.x86_64 7/52 Running scriptlet: systemd-239-41.el8_3.1.x86_64 7/52 Upgrading : systemd-pam-239-41.el8_3.1.x86_64 8/52 Verifying : kernel-modules-4.18.0-240.8.1.el8_3.x86_64 1/52 Verifying : kernel-core-4.18.0-240.8.1.el8_3.x86_64 2/52 Verifying : kernel-4.18.0-240.8.1.el8_3.x86_64 3/52 Verifying : linux-firmware-20200619-101.git3890db36.el8_3.noarch 4/52 Verifying : cloud-init-19.4-11.el8_3.1.noarch 5/52 Verifying : cloud-init-19.4-11.el8.noarch 6/52 Verifying : insights-client-3.1.1-1.el8_3.noarch 7/52 Verifying : insights-client-3.1.0-3.el8.noarch 8/52 Upgraded: NetworkManager-1:1.26.0-12.el8_3.x86_64 NetworkManager-libnm-1:1.26.0-12.el8_3.x86_64 NetworkManager-team-1:1.26.0-12.el8_3.x86_64 NetworkManager-tui-1:1.26.0-12.el8_3.x86_64 cloud-init-19.4-11.el8_3.1.noarch curl-7.61.1-14.el8_3.1.x86_64 freetype-2.9.1-4.el8_3.1.x86_64 gnutls-3.6.14-7.el8_3.x86_64 insights-client-3.1.1-1.el8_3.noarch iptables-libs-1.8.4-15.el8_3.3.x86_64 kernel-tools-4.18.0-240.8.1.el8_3.x86_64 kernel-tools-libs-4.18.0-240.8.1.el8_3.x86_64 kexec-tools-2.0.20-34.el8_3.1.x86_64 libcurl-7.61.1-14.el8_3.1.x86_64 microcode_ctl-4:20200609-2.20201112.1.el8_3.x86_64 openssl-1:1.1.1g-12.el8_3.x86_64 openssl-libs-1:1.1.1g-12.el8_3.x86_64 python3-perf-4.18.0-240.8.1.el8_3.x86_64 qemu-guest-agent-15:4.2.0-34.module+el8.3.0+8829+e7a0a3ea.1.x86_64 systemd-239-41.el8_3.1.x86_64 systemd-libs-239-41.el8_3.1.x86_64 systemd-pam-239-41.el8_3.1.x86_64 systemd-udev-239-41.el8_3.1.x86_64 tuned-2.14.0-3.el8_3.1.noarch Installed: kernel-4.18.0-240.8.1.el8_3.x86_64 kernel-core-4.18.0-240.8.1.el8_3.x86_64 kernel-modules-4.18.0-240.8.1.el8_3.x86_64 linux-firmware-20200619-101.git3890db36.el8_3.noarch Complete! |
6. Install wget package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
[root@ip-172-31-41-7 ec2-user]# yum install wget -y Last metadata expiration check: 0:04:39 ago on Mon 28 Dec 2020 08:06:57 AM UTC. Dependencies resolved. ============================================================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================================================== Installing: wget x86_64 1.19.5-10.el8 rhel-8-appstream-rhui-rpms 734 k Transaction Summary ============================================================================================================================================================================================================== Install 1 Package Total download size: 734 k Installed size: 2.8 M Downloading Packages: wget-1.19.5-10.el8.x86_64.rpm 5.0 MB/s | 734 kB 00:00 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 3.9 MB/s | 734 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : wget-1.19.5-10.el8.x86_64 1/1 Running scriptlet: wget-1.19.5-10.el8.x86_64 1/1 Verifying : wget-1.19.5-10.el8.x86_64 1/1 Installed: wget-1.19.5-10.el8.x86_64 Complete! |
7. Install MySQL 5.7
We can install MySQL 5.7 by using below link.
8. Upgrade MySQL from 5.7 to 8.0
Check the Status of MySQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@ip-172-31-41-7 ec2-user]# service mysqld start Redirecting to /bin/systemctl start mysqld.service [root@ip-172-31-41-7 ec2-user]# service mysqld status Redirecting to /bin/systemctl status mysqld.service ● mysqld.service - MySQL Community Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2020-12-28 08:22:56 UTC; 4s ago Process: 58906 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS) Process: 58846 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 58905 (mysqld_safe) Tasks: 23 (limit: 4836) Memory: 493.3M CGroup: /system.slice/mysqld.service ├─58905 /bin/sh /usr/bin/mysqld_safe --basedir=/usr └─59080 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysq> |
Install MySQL Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
[root@ip-172-31-36-253 ec2-user]# yum install mysql-shell Last metadata expiration check: 0:13:48 ago on Mon 28 Dec 2020 05:11:59 PM UTC. Dependencies resolved. ===================================================================================================================================================================== Package Architecture Version Repository Size ===================================================================================================================================================================== Installing: mysql-shell x86_64 8.0.22-1.el7 mysql-tools-community 29 M Installing dependencies: compat-openssl10 x86_64 1:1.0.2o-3.el8 rhel-8-appstream-rhui-rpms 1.1 M make x86_64 1:4.2.1-10.el8 rhel-8-baseos-rhui-rpms 498 k Transaction Summary ===================================================================================================================================================================== Install 3 Packages Total download size: 31 M Installed size: 133 M Is this ok [y/N]: y Downloading Packages: (1/3): make-4.2.1-10.el8.x86_64.rpm 3.4 MB/s | 498 kB 00:00 (2/3): compat-openssl10-1.0.2o-3.el8.x86_64.rpm 7.6 MB/s | 1.1 MB 00:00 (3/3): mysql-shell-8.0.22-1.el7.x86_64.rpm 76 MB/s | 29 MB 00:00 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 64 MB/s | 31 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : make-1:4.2.1-10.el8.x86_64 1/3 Running scriptlet: make-1:4.2.1-10.el8.x86_64 1/3 Installing : compat-openssl10-1:1.0.2o-3.el8.x86_64 2/3 Running scriptlet: compat-openssl10-1:1.0.2o-3.el8.x86_64 2/3 Installing : mysql-shell-8.0.22-1.el7.x86_64 3/3 Running scriptlet: mysql-shell-8.0.22-1.el7.x86_64 3/3 Verifying : mysql-shell-8.0.22-1.el7.x86_64 1/3 Verifying : compat-openssl10-1:1.0.2o-3.el8.x86_64 2/3 Verifying : make-1:4.2.1-10.el8.x86_64 3/3 Installed: compat-openssl10-1:1.0.2o-3.el8.x86_64 make-1:4.2.1-10.el8.x86_64 mysql-shell-8.0.22-1.el7.x86_64 Complete! |
Check the migration issues of Database data
Note : please resolve the issues before the upgrade
when you do upgrading the software binaries but not touch the data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
[root@ip-172-31-36-253 ec2-user]# mysqlsh -- util checkForServerUpgrade root@localhost:3306 --target-version=8.0.21 --output-format=text --config-path=/etc/my.cnf Please provide the password for 'root@localhost:3306': *********** Save password for 'root@localhost:3306'? [Y]es/[N]o/Ne[v]er (default No): Y The MySQL server at localhost:3306, version 5.7.32 - MySQL Community Server (GPL), will now be checked for compatibility issues for upgrade to MySQL 8.0.21... 1) Usage of old temporal type No issues found 2) Usage of db objects with names conflicting with new reserved keywords No issues found 3) Usage of utf8mb3 charset No issues found 4) Table names in the mysql schema conflicting with new tables in 8.0 No issues found 5) Partitioned tables using engines with non native partitioning No issues found 6) Foreign key constraint names longer than 64 characters No issues found 7) Usage of obsolete MAXDB sql_mode flag No issues found 8) Usage of obsolete sql_mode flags Notice: The following DB objects have obsolete options persisted for sql_mode, which will be cleared during upgrade to 8.0. More information: https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html#mysql-nutshell-removals global system variable sql_mode - defined using obsolete NO_AUTO_CREATE_USER option 9) ENUM/SET column definitions containing elements longer than 255 characters No issues found 10) Usage of partitioned tables in shared tablespaces No issues found 11) Circular directory references in tablespace data file paths No issues found 12) Usage of removed functions No issues found 13) Usage of removed GROUP BY ASC/DESC syntax No issues found 14) Removed system variables for error logging to the system log configuration No issues found 15) Removed system variables No issues found 16) System variables with new default values Warning: Following system variables that are not defined in your configuration file will have new default values. Please review if you rely on their current values and if so define them before performing upgrade. More information: https://mysqlserverteam.com/new-defaults-in-mysql-8-0/ back_log - default value will change character_set_server - default value will change from latin1 to utf8mb4 collation_server - default value will change from latin1_swedish_ci to utf8mb4_0900_ai_ci event_scheduler - default value will change from OFF to ON explicit_defaults_for_timestamp - default value will change from OFF to ON innodb_autoinc_lock_mode - default value will change from 1 (consecutive) to 2 (interleaved) innodb_flush_method - default value will change from NULL to fsync (Unix), unbuffered (Windows) innodb_flush_neighbors - default value will change from 1 (enable) to 0 (disable) innodb_max_dirty_pages_pct - default value will change from 75 (%) 90 (%) innodb_max_dirty_pages_pct_lwm - default value will change from_0 (%) to 10 (%) innodb_undo_log_truncate - default value will change from OFF to ON innodb_undo_tablespaces - default value will change from 0 to 2 log_bin - default value will change from OFF to ON log_error_verbosity - default value will change from 3 (Notes) to 2 (Warning) log_slave_updates - default value will change from OFF to ON master_info_repository - default value will change from FILE to TABLE max_allowed_packet - default value will change from 4194304 (4MB) to 67108864 (64MB) max_error_count - default value will change from 64 to 1024 optimizer_trace_max_mem_size - default value will change from 16KB to 1MB performance_schema_consumer_events_transactions_current - default value will change from OFF to ON performance_schema_consumer_events_transactions_history - default value will change from OFF to ON relay_log_info_repository - default value will change from FILE to TABLE server_id - default value will change from 0 to 1 slave_rows_search_algorithms - default value will change from 'INDEX_SCAN, TABLE_SCAN' to 'INDEX_SCAN, HASH_SCAN' table_open_cache - default value will change from 2000 to 4000 transaction_write_set_extraction - default value will change from OFF to XXHASH64 17) Zero Date, Datetime, and Timestamp values No issues found 18) Schema inconsistencies resulting from file removal or corruption No issues found 19) Tables recognized by InnoDB that belong to a different engine No issues found 20) Issues reported by 'check table x for upgrade' command No issues found 21) New default authentication plugin considerations Warning: The new default authentication plugin 'caching_sha2_password' offers more secure password hashing than previously used 'mysql_native_password' (and consequent improved client connection authentication). However, it also has compatibility implications that may affect existing MySQL installations. If your MySQL installation must serve pre-8.0 clients and you encounter compatibility issues after upgrading, the simplest way to address those issues is to reconfigure the server to revert to the previous default authentication plugin (mysql_native_password). For example, use these lines in the server option file: [mysqld] default_authentication_plugin=mysql_native_password However, the setting should be viewed as temporary, not as a long term or permanent solution, because it causes new accounts created with the setting in effect to forego the improved authentication security. If you are using replication please take time to understand how the authentication plugin changes may impact you. More information: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password-compatibility-issues https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password-replication Errors: 0 Warnings: 27 Notices: 1 No fatal errors were found that would prevent an upgrade, but some potential issues were detected. Please ensure that the reported issues are not significant before upgrading. |
Stop the Service of MySQL 5.6
1 2 |
[root@ip-172-31-36-253 ec2-user]# service mysqld stop Redirecting to /bin/systemctl stop mysqld.service |
Check the Status of MySQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@ip-172-31-36-253 ec2-user]# service mysqld status Redirecting to /bin/systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: inactive (dead) since Mon 2020-12-28 17:33:55 UTC; 3s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 62363 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 62346 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 62366 (code=exited, status=0/SUCCESS) Dec 28 17:28:26 ip-172-31-36-253.ap-south-1.compute.internal systemd[1]: Starting MySQL Server... Dec 28 17:28:26 ip-172-31-36-253.ap-south-1.compute.internal systemd[1]: Started MySQL Server. Dec 28 17:33:54 ip-172-31-36-253.ap-south-1.compute.internal systemd[1]: Stopping MySQL Server... Dec 28 17:33:55 ip-172-31-36-253.ap-south-1.compute.internal systemd[1]: mysqld.service: Succeeded. Dec 28 17:33:55 ip-172-31-36-253.ap-south-1.compute.internal systemd[1]: Stopped MySQL Server. |
Remove Binaries of MySQL 5.7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
[root@ip-172-31-36-253 ec2-user]# yum remove mysql-community* No match for argument: mysql-community-release-el7-5.noarch.rpm No packages marked for removal. Dependencies resolved. Nothing to do. Complete! [root@ip-172-31-36-253 ec2-user]# yum remove mysql-community-server* Dependencies resolved. ===================================================================================================================================================================== Package Architecture Version Repository Size ===================================================================================================================================================================== Removing: mysql-community-server x86_64 5.7.32-1.el7 @mysql57-community 762 M Removing unused dependencies: libaio x86_64 0.3.112-1.el8 @rhel-8-baseos-rhui-rpms 93 k mysql-community-client x86_64 5.7.32-1.el7 @mysql57-community 101 M mysql-community-common x86_64 5.7.32-1.el7 @mysql57-community 2.8 M mysql-community-libs x86_64 5.7.32-1.el7 @mysql57-community 9.4 M ncurses-compat-libs x86_64 6.1-7.20180224.el8 @rhel-8-baseos-rhui-rpms 1.2 M perl-Carp noarch 1.42-396.el8 @rhel-8-baseos-rhui-rpms 41 k perl-Data-Dumper x86_64 2.167-399.el8 @rhel-8-baseos-rhui-rpms 104 k perl-Digest noarch 1.17-395.el8 @rhel-8-appstream-rhui-rpms 26 k perl-Digest-MD5 x86_64 2.55-396.el8 @rhel-8-appstream-rhui-rpms 55 k perl-Encode x86_64 4:2.97-3.el8 @rhel-8-baseos-rhui-rpms 9.7 M perl-Errno x86_64 1.28-416.el8 @rhel-8-baseos-rhui-rpms 9.3 k perl-Exporter noarch 5.72-396.el8 @rhel-8-baseos-rhui-rpms 54 k Transaction Summary ===================================================================================================================================================================== Remove 47 Packages Freed space: 912 M Is this ok [y/N]: y Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: mysql-community-server-5.7.32-1.el7.x86_64 1/1 Running scriptlet: mysql-community-server-5.7.32-1.el7.x86_64 1/47 Erasing : mysql-community-server-5.7.32-1.el7.x86_64 1/47 Running scriptlet: mysql-community-server-5.7.32-1.el7.x86_64 1/47 Erasing : perl-libnet-3.11-3.el8.noarch 2/47 Erasing : perl-URI-1.73-3.el8.noarch 3/47 Erasing : perl-IO-Socket-SSL-2.066-4.module+el8.3.0+6446+594cad75.noarch 4/47 Erasing : perl-HTTP-Tiny-0.074-1.el8.noarch 5/47 Erasing : perl-Encode-4:2.97-3.el8.x86_64 6/47 Erasing : perl-Pod-Simple-1:3.35-395.el8.noarch 7/47 Erasing : perl-podlators-4.11-1.el8.noarch 8/47 Verifying : libaio-0.3.112-1.el8.x86_64 1/47 Verifying : mysql-community-client-5.7.32-1.el7.x86_64 2/47 Verifying : mysql-community-common-5.7.32-1.el7.x86_64 3/47 Verifying : mysql-community-libs-5.7.32-1.el7.x86_64 4/47 Verifying : mysql-community-server-5.7.32-1.el7.x86_64 5/47 Verifying : ncurses-compat-libs-6.1-7.20180224.el8.x86_64 6/47 Verifying : perl-Carp-1.42-396.el8.noarch 7/47 Verifying : perl-Data-Dumper-2.167-399.el8.x86_64 8/47 Removed: libaio-0.3.112-1.el8.x86_64 mysql-community-client-5.7.32-1.el7.x86_64 mysql-community-common-5.7.32-1.el7.x86_64 mysql-community-libs-5.7.32-1.el7.x86_64 mysql-community-server-5.7.32-1.el7.x86_64 ncurses-compat-libs-6.1-7.20180224.el8.x86_64 perl-Carp-1.42-396.el8.noarch perl-Data-Dumper-2.167-399.el8.x86_64 perl-Digest-1.17-395.el8.noarch perl-Digest-MD5-2.55-396.el8.x86_64 perl-Encode-4:2.97-3.el8.x86_64 perl-Errno-1.28-416.el8.x86_64 perl-Exporter-5.72-396.el8.noarch perl-File-Path-2.15-2.el8.noarch perl-File-Temp-0.230.600-1.el8.noarch perl-Getopt-Long-1:2.50-4.el8.noarch perl-HTTP-Tiny-0.074-1.el8.noarch perl-IO-1.38-416.el8.x86_64 perl-IO-Socket-IP-0.39-5.el8.noarch perl-IO-Socket-SSL-2.066-4.module+el8.3.0+6446+594cad75.noarch perl-MIME-Base64-3.15-396.el8.x86_64 perl-Mozilla-CA-20160104-7.module+el8.3.0+6498+9eecfe51.noarch perl-Net-SSLeay-1.88-1.module+el8.3.0+6446+594cad75.x86_64 perl-PathTools-3.74-1.el8.x86_64 perl-Pod-Escapes-1:1.07-395.el8.noarch perl-Pod-Perldoc-3.28-396.el8.noarch perl-Pod-Simple-1:3.35-395.el8.noarch perl-Pod-Usage-4:1.69-395.el8.noarch perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 perl-Socket-4:2.027-3.el8.x86_64 perl-Storable-1:3.11-3.el8.x86_64 perl-Term-ANSIColor-4.06-396.el8.noarch perl-Term-Cap-1.17-395.el8.noarch perl-Text-ParseWords-3.30-395.el8.noarch perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch perl-Time-Local-1:1.280-1.el8.noarch perl-URI-1.73-3.el8.noarch perl-Unicode-Normalize-1.25-396.el8.x86_64 perl-constant-1.33-396.el8.noarch perl-interpreter-4:5.26.3-416.el8.x86_64 perl-libnet-3.11-3.el8.noarch perl-libs-4:5.26.3-416.el8.x86_64 perl-macros-4:5.26.3-416.el8.x86_64 perl-parent-1:0.237-1.el8.noarch perl-podlators-4.11-1.el8.noarch perl-threads-1:2.21-2.el8.x86_64 perl-threads-shared-1.58-2.el8.x86_64 Complete! |
Download Binaries of MySQL 8.0 (RPM)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@ip-172-31-12-117 ec2-user]# wget https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm --2021-01-01 11:12:44-- https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm Resolving repo.mysql.com (repo.mysql.com)... 104.120.171.24 Connecting to repo.mysql.com (repo.mysql.com)|104.120.171.24|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 26024 (25K) [application/x-redhat-package-manager] Saving to: ‘mysql80-community-release-el7-3.noarch.rpm’ mysql80-community-release-el7-3.noarch.rpm 100%[=================================================================================================================>] 25.41K --.-KB/s in 0.02s 2021-01-01 11:12:44 (1.26 MB/s) - ‘mysql80-community-release-el7-3.noarch.rpm’ saved [26024/26024] [root@ip-172-31-12-117 ec2-user]# ll total 40 -rw-r--r--. 1 root root 9224 Sep 12 2016 mysql57-community-release-el7-9.noarch.rpm -rw-r--r--. 1 root root 26024 Apr 24 2019 mysql80-community-release-el7-3.noarch.rpm |
Install Binareis of MySQL 8.0 (RPM)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
[root@ip-172-31-36-253 ec2-user]# yum localinstall mysql80-community-release-el7-3.noarch.rpm --allowerasing Last metadata expiration check: 0:27:46 ago on Mon 28 Dec 2020 05:11:59 PM UTC. Dependencies resolved. ===================================================================================================================================================================== Package Architecture Version Repository Size ===================================================================================================================================================================== Installing: mysql80-community-release noarch el7-3 @commandline 25 k Removing dependent packages: mysql57-community-release noarch el7-9 @@commandline 8.6 k Transaction Summary ===================================================================================================================================================================== Install 1 Package Remove 1 Package Total size: 25 k Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : mysql80-community-release-el7-3.noarch 1/2 Erasing : mysql57-community-release-el7-9.noarch 2/2 Verifying : mysql80-community-release-el7-3.noarch 1/2 Verifying : mysql57-community-release-el7-9.noarch 2/2 Installed: mysql80-community-release-el7-3.noarch Removed: mysql57-community-release-el7-9.noarch Complete! |
Install MySQL 8.0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
[root@ip-172-31-36-253 ec2-user]# yum install mysql-community-server* MySQL 8.0 Community Server 17 MB/s | 1.5 MB 00:00 Dependencies resolved. ===================================================================================================================================================================== Package Architecture Version Repository Size ===================================================================================================================================================================== Installing: mysql-community-server x86_64 8.0.22-1.el7 mysql80-community 510 M Installing dependencies: libaio x86_64 0.3.112-1.el8 rhel-8-baseos-rhui-rpms 33 k mysql-community-client x86_64 8.0.22-1.el7 mysql80-community 48 M mysql-community-client-plugins x86_64 8.0.22-1.el7 mysql80-community 235 k mysql-community-common x86_64 8.0.22-1.el7 mysql80-community 616 k mysql-community-libs x86_64 8.0.22-1.el7 mysql80-community 4.6 M ncurses-compat-libs x86_64 6.1-7.20180224.el8 rhel-8-baseos-rhui-rpms 331 k perl-Carp noarch 1.42-396.el8 rhel-8-baseos-rhui-rpms 30 k perl-Data-Dumper x86_64 2.167-399.el8 rhel-8-baseos-rhui-rpms 58 k perl-Digest noarch 1.17-395.el8 rhel-8-appstream-rhui-rpms 27 k perl-Digest-MD5 x86_64 2.55-396.el8 rhel-8-appstream-rhui-rpms 37 k perl-Encode x86_64 4:2.97-3.el8 rhel-8-baseos-rhui-rpms 1.5 M perl-Errno x86_64 1.28-416.el8 rhel-8-baseos-rhui-rpms 76 k Transaction Summary ===================================================================================================================================================================== Install 48 Packages Total download size: 575 M Installed size: 2.6 G Is this ok [y/N]: y Downloading Packages: (1/48): mysql-community-common-8.0.22-1.el7.x86_64.rpm 11 MB/s | 616 kB 00:00 (2/48): mysql-community-libs-8.0.22-1.el7.x86_64.rpm 45 MB/s | 4.6 MB 00:00 (3/48): mysql-community-client-plugins-8.0.22-1.el7.x86_64.rpm 507 kB/s | 235 kB 00:00 (4/48): perl-Mozilla-CA-20160104-7.module+el8.3.0+6498+9eecfe51.noarch.rpm 136 kB/s | 15 kB 00:00 (5/48): perl-URI-1.73-3.el8.noarch.rpm 955 kB/s | 116 kB 00:00 (6/48): mysql-community-client-8.0.22-1.el7.x86_64.rpm 54 MB/s | 48 MB 00:00 (7/48): perl-Net-SSLeay-1.88-1.module+el8.3.0+6446+594cad75.x86_64.rpm 1.9 MB/s | 379 kB 00:00 (8/48): perl-Digest-1.17-395.el8.noarch.rpm 270 kB/s | 27 kB 00:00 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 41 MB/s | 575 MB 00:13 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : perl-libs-4:5.26.3-416.el8.x86_64 1/48 Installing : perl-Exporter-5.72-396.el8.noarch 2/48 Installing : perl-Carp-1.42-396.el8.noarch 3/48 Installing : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 4/48 Installing : perl-parent-1:0.237-1.el8.noarch 5/48 Installing : perl-Text-ParseWords-3.30-395.el8.noarch 6/48 Installing : mysql-community-common-8.0.22-1.el7.x86_64 7/48 Installing : mysql-community-client-plugins-8.0.22-1.el7.x86_64 8/48 Verifying : mysql-community-client-8.0.22-1.el7.x86_64 1/48 Verifying : mysql-community-client-plugins-8.0.22-1.el7.x86_64 2/48 Verifying : mysql-community-common-8.0.22-1.el7.x86_64 3/48 Verifying : mysql-community-libs-8.0.22-1.el7.x86_64 4/48 Verifying : mysql-community-server-8.0.22-1.el7.x86_64 5/48 Verifying : perl-Mozilla-CA-20160104-7.module+el8.3.0+6498+9eecfe51.noarch 6/48 Verifying : perl-URI-1.73-3.el8.noarch 7/48 Verifying : perl-Net-SSLeay-1.88-1.module+el8.3.0+6446+594cad75.x86_64 8/48 Installed: libaio-0.3.112-1.el8.x86_64 mysql-community-client-8.0.22-1.el7.x86_64 mysql-community-client-plugins-8.0.22-1.el7.x86_64 mysql-community-common-8.0.22-1.el7.x86_64 mysql-community-libs-8.0.22-1.el7.x86_64 mysql-community-server-8.0.22-1.el7.x86_64 ncurses-compat-libs-6.1-7.20180224.el8.x86_64 perl-Carp-1.42-396.el8.noarch perl-Data-Dumper-2.167-399.el8.x86_64 perl-Digest-1.17-395.el8.noarch perl-Digest-MD5-2.55-396.el8.x86_64 perl-Encode-4:2.97-3.el8.x86_64 perl-Errno-1.28-416.el8.x86_64 perl-Exporter-5.72-396.el8.noarch perl-File-Path-2.15-2.el8.noarch perl-File-Temp-0.230.600-1.el8.noarch perl-Getopt-Long-1:2.50-4.el8.noarch perl-HTTP-Tiny-0.074-1.el8.noarch perl-IO-1.38-416.el8.x86_64 perl-IO-Socket-IP-0.39-5.el8.noarch perl-IO-Socket-SSL-2.066-4.module+el8.3.0+6446+594cad75.noarch perl-MIME-Base64-3.15-396.el8.x86_64 perl-Mozilla-CA-20160104-7.module+el8.3.0+6498+9eecfe51.noarch perl-Net-SSLeay-1.88-1.module+el8.3.0+6446+594cad75.x86_64 perl-PathTools-3.74-1.el8.x86_64 perl-Pod-Escapes-1:1.07-395.el8.noarch perl-Pod-Perldoc-3.28-396.el8.noarch perl-Pod-Simple-1:3.35-395.el8.noarch perl-Pod-Usage-4:1.69-395.el8.noarch perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 Complete! |
Check Version of MySQL
1 2 |
[root@ip-172-31-36-253 ec2-user]# mysql -V mysql Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL) |
Start the Service of MySQL
1 2 |
[root@ip-172-31-36-253 ec2-user]# service mysqld start Redirecting to /bin/systemctl start mysqld.service |
Check the Status of MySQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@ip-172-31-36-253 ec2-user]# service mysqld status Redirecting to /bin/systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2020-12-28 17:46:33 UTC; 16s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 65171 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 65196 (mysqld) Status: "Server is operational" Tasks: 38 (limit: 4836) Memory: 523.5M CGroup: /system.slice/mysqld.service └─65196 /usr/sbin/mysqld Dec 28 17:46:23 ip-172-31-36-253.ap-south-1.compute.internal systemd[1]: Starting MySQL Server... Dec 28 17:46:33 ip-172-31-36-253.ap-south-1.compute.internal systemd[1]: Started MySQL Server. |
Connect to MySQL 8.0 Database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@ip-172-31-36-253 ec2-user]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 8.0.22 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> |
Check the version of MySQL 8.0 Database
1 2 3 4 5 6 7 8 9 10 |
mysql> select @@version; +-----------+ | @@version | +-----------+ | 8.0.22 | +-----------+ 1 row in set (0.00 sec) mysql> exit Bye |
Setting the root Password
This command enables you to improve the security of your MySQL installation in the following ways:
👉 You can set a password for root accounts.
👉 You can remove root accounts that are accessible from outside the local host.
👉 You can remove anonymous-user accounts.
👉 You can remove the test database, which by default can be accessed by anonymous users.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
[root@ip-172-31-36-253 ec2-user]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin? Press y|Y for Yes, any other key for No: Using existing password for root. Change the password for root ? ((Press y|Y for Yes, any other key for No) : ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. |
Connect to MySQL 8.0 Database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@ip-172-31-36-253 ec2-user]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 8.0.22 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> |
Check the version of MySQL 8.0 Database
1 2 3 4 5 6 7 8 9 10 |
mysql> select @@version; +-----------+ | @@version | +-----------+ | 8.0.22 | +-----------+ 1 row in set (0.00 sec) mysql> exit Bye |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform
Follow Me
Ramesh’s Linkedin : Ramesh Atchala