Otu esi etinye MySQL 8.0 na RHEL/CentOS 8/7 na Fedora 35


MySQL bụ sistemu njikwa nchekwa data n'efu (RDBMS) ewepụtara n'okpuru GNU (General Public License). A na-eji ya na-agba ọsọ ọtụtụ ọdụ data na ihe nkesa ọ bụla site n'inye ọtụtụ ndị ọrụ ohere ịnweta nchekwa data ọ bụla kere.

Edemede a ga-agafe gị usoro nke ịwụnye na imelite ụdị MySQL 8.0 kachasị ọhụrụ na RHEL/CentOS 8/7/6/ na Fedora site na iji MySQL Yum repository site na ịba uru YUM.

Kwụpụ 1: Ịgbakwunye MySQL Yum Repository

1. Anyị ga-eji ebe nchekwa ngwanrọ MySQL Yum, nke ga-enye ngwugwu RPM maka ịwụnye ụdị MySQL ọhụrụ, onye ahịa, MySQL Utilities, MySQL Workbench, Connector/ODBC, na Connector/Python maka RHEL/CentOS 8/7 /6/ na Fedora 30-35.

Ihe dị mkpa: Ntuziaka ndị a na-arụ ọrụ na ntinye ọhụrụ nke MySQL na ihe nkesa ahụ, ọ bụrụ na enweelarị MySQL arụnyere site na iji ngwugwu RPM nke ndị ọzọ kesara, m na-akwado gị ka ịkwalite ma ọ bụ dochie ngwugwu MySQL arụnyere site na iji MySQL Yum Repository. .

Tupu ịkwalite ma ọ bụ dochie ngwugwu MySQL ochie, echefula iwere nchekwa data niile dị mkpa na faịlụ nhazi site na iji ndabere MySQL Databases ndu.

2. Ugbu a budata ma gbakwunye ebe nchekwa MySQL Yum ndị a na ndepụta nchekwa nkesa Linux nke gị ka ịwụnye ụdị MySQL kachasị ọhụrụ (ya bụ 8.0 ewepụtara na 27 Julaị 2018).

--------------- On RHEL/CentOS 8 ---------------
# wget https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm
--------------- On RHEL/CentOS 7 ---------------
# wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
--------------- On RHEL/CentOS 6 ---------------
# wget https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm
--------------- On Fedora 35 ---------------
# wget https://dev.mysql.com/get/mysql80-community-release-fc35-1.noarch.rpm
--------------- On Fedora 34 ---------------
# wget https://dev.mysql.com/get/mysql80-community-release-fc34-1.noarch.rpm
--------------- On Fedora 33 ---------------
# wget https://dev.mysql.com/get/mysql80-community-release-fc33-1.noarch.rpm

3. Mgbe nbudata ngwugwu maka ikpo okwu Linux gị, ugbu a wụnye ngwugwu ebudatara na iwu a.

--------------- On RHEL/CentOS 8 ---------------
# yum localinstall mysql80-community-release-el8-1.noarch.rpm
--------------- On RHEL/CentOS 7 ---------------
# yum localinstall mysql80-community-release-el7-1.noarch.rpm
--------------- On RHEL/CentOS 6 ---------------
# yum localinstall mysql80-community-release-el6-1.noarch.rpm
--------------- On Fedora 35 ---------------
# dnf localinstall mysql80-community-release-fc35-1.noarch.rpm
--------------- On Fedora 34 ---------------
# dnf localinstall mysql80-community-release-fc34-1.noarch.rpm
--------------- On Fedora 33 ---------------
# yum localinstall mysql80-community-release-fc33-1.noarch.rpm

Iwu nrụnye dị n'elu na-agbakwunye MySQL Yum nchekwa na ndepụta nchekwa sistemụ wee budata igodo GnuPG iji chọpụta iguzosi ike n'ezi ihe nke ngwugwu ahụ.

4. Ị nwere ike nyochaa na MySQL Yum nchekwa agbakwunyere nke ọma site na iji iwu na-esonụ.

# yum repolist enabled | grep "mysql.*-community.*"
# dnf repolist enabled | grep "mysql.*-community.*"      [On Fedora versions]

Kwụpụ 2: Ịwụnye ụdị MySQL ọhụrụ

5. Wụnye ụdị MySQL kachasị ọhụrụ (ugbu a 8.0) site na iji iwu a.

# yum install mysql-community-server
# dnf install mysql-community-server      [On Fedora versions]

Iwu a dị n'elu na-arụnye ngwugwu niile achọrọ maka MySQL sava mysql-community-server, mysql-community-client, mysql-community-common na mysql-community-libs.

Kwụpụ 3: Ịwụnye ụdị mwepụta MySQL dị iche iche

6. Ị nwekwara ike iwunye ụdị MySQL dị iche iche site na iji ebe nchekwa dị iche iche nke MySQL Community Server. Ebe nchekwa nchekwa maka usoro MySQL na-adịbeghị anya (ugbu a MySQL 8.0) na-arụ ọrụ site na ndabara, yana ebe nchekwa maka ụdị ndị ọzọ niile (dịka ọmụmaatụ, usoro MySQL 5.x) na ndabara.

Iji wụnye otu ụdị sitere na mpaghara nchekwa mpaghara akọwapụtara, ị nwere ike iji --enable ma ọ bụ -- gbanyụọ nhọrọ site na iji yum-config-manager ma ọ bụ dnf config-manager dị ka egosiri. :

# yum-config-manager --disable mysql57-community
# yum-config-manager --enable mysql56-community
------------------ Fedora Versions ------------------
# dnf config-manager --disable mysql57-community
# dnf config-manager --enable mysql56-community

Kwụpụ 4: Malite MySQL Server

7. Mgbe emechara nke ọma nke MySQL, ọ bụ oge ịmalite ma mee ka ihe nkesa MySQL nwee iwu ndị a:

# service mysqld start
# systemctl enable mysqld.service

Ị nwere ike nyochaa ọkwa nke ihe nkesa MySQL site n'enyemaka nke iwu na-esonụ.

# systemctl status mysqld.service
OR
# service mysqld status

Nke a bụ ihe nlele nke na-agba ọsọ MySQL n'okpuru igbe CentOS 7 m.

Redirecting to /bin/systemctl status  mysqld.service
mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
   Active: active (running) since Thu 2015-10-29 05:15:19 EDT; 4min 5s ago
  Process: 5314 ExecStart=/usr/sbin/mysqld --daemonize $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 5298 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 5317 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─5317 /usr/sbin/mysqld --daemonize

Oct 29 05:15:19 localhost.localdomain systemd[1]: Started MySQL Server.

8. Ugbu a n'ikpeazụ nyochaa arụnyere MySQL version iji na-esonụ iwu.

# mysql --version

mysql  Ver 8.0.27 for Linux on x86_64 (MySQL Community Server - GPL)

Kwụpụ 5: Chekwaa nwụnye MySQL

9. Iwu mysql_secure_installation na-enye gị ohere ịchekwa nrụnye MySQL gị site na ịme ntọala dị mkpa dị ka ịtọ ntọala paswọọdụ mgbọrọgwụ, wepụ ndị ọrụ na-amaghị aha, wepụ mgbọrọgwụ nbanye, na na.

Mara: MySQL ụdị 8.0 ma ọ bụ karịa na-ewepụta paswọọdụ na-adịru nwa oge na /var/log/mysqld.log mgbe echichi gasịrị.

Jiri iwu dị n'okpuru ka ịhụ paswọọdụ tupu ị na-agba ọsọ MySQL iwu nchekwa.

# grep 'temporary password' /var/log/mysqld.log

Ozugbo ịmara paswọọdụ ị nwere ike ịgba ọsọ ugbu a iwu na-esonụ iji chekwaa nrụnye MySQL gị.

# mysql_secure_installation

Mara: Tinye mgbọrọgwụ mgbọrọgwụ pụtara okwuntughe nwa oge gị site na faịlụ /var/log/mysqld.log.

Ugbu a soro ntuziaka onscreen nke ọma, maka ntụnye aka hụ mmepụta nke iwu dị n'okpuru.

Securing the MySQL server deployment.

Enter password for user root: Enter New Root Password

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: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Using existing password for root.

Estimated strength of the password: 50 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: Set New MySQL Password

Re-enter new password: Re-enter New MySQL Password

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
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.

All done! 

Kwụpụ 6: Jikọọ na MySQL Server

10. Jikọọ na ihe nkesa MySQL arụnyere ọhụrụ site n'inye aha njirimara na paswọọdụ.

# mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.27 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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>

Kwụpụ 7: Na-emelite MySQL na Yum

11. E wezụga ọhụrụ echichi, ị nwekwara ike ime mmelite maka MySQL ngwaahịa na components na enyemaka nke na-esonụ iwu.

# yum update mysql-server
# dnf update mysql-server       [On Fedora versions]

Mgbe mmelite ọhụrụ dị maka MySQL, ọ ga-etinye ya na akpaghị aka, ọ bụrụ na ọ bụghị, ị ga-enweta ozi na-ekwu NO ngwugwu akara maka mmelite.

Nke ahụ bụ ya, ị tinyela MySQL 8.0 nke ọma na sistemụ gị. Ọ bụrụ na ị na-enwe nsogbu ọ bụla ịwụnye, nweere onwe gị iji ngalaba nkọwa anyị maka azịza.