RHEL / CentOS और Fedora पर नवीनतम MySQL 8.0 कैसे स्थापित करें


MySQL एक खुला स्रोत मुक्त संबंधपरक डेटाबेस प्रबंधन प्रणाली (RDBMS) है जो GNU (जनरल लाइसेंस) के तहत जारी किया जाता है। इसका उपयोग किसी भी एकल सर्वर पर बहु-उपयोगकर्ता द्वारा प्रत्येक बनाए गए डेटाबेस में बहु-उपयोगकर्ता पहुँच प्रदान करने के लिए किया जाता है।

लाल

चरण 1: MySQL यम रिपॉजिटरी को जोड़ना

1। हम आधिकारिक का उपयोग करेंगे MySQL यम सॉफ़्टवेयर रिपॉजिटरी, जो MySQL सर्वर, क्लाइंट, MySQL उपयोगिताएँ, MySQL कार्यक्षेत्र, कनेक्टर/ODBC के नवीनतम संस्करण को स्थापित करने के लिए RPM संकुल प्रदान करेगा , और RHEL/CentOS 7/6/ और फेडोरा 28-26 के लिए कनेक्टर/पायथन।

लाल

पुराने MySQL पैकेज को अपग्रेड करने या बदलने से पहले, सभी महत्वपूर्ण डेटाबेस बैकअप और कॉन्फ़िगरेशन फ़ाइलों को लेना न भूलें।

2। अब डाउनलोड करें और अपने संबंधित लिनक्स वितरण प्रणाली की रिपॉजिटरी सूची में MySQL Yum रिपॉजिटरी डाउनलोड करें और जोड़ें और MySQL (यानी 8.0 ) के नवीनतम संस्करण को स्थापित करें 27 जुलाई 2018 ) को जारी किया गया।

--------------- 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 28 ---------------
# wget https://dev.mysql.com/get/mysql80-community-release-fc28-1.noarch.rpm
--------------- On Fedora 27 ---------------
# wget https://dev.mysql.com/get/mysql80-community-release-fc27-1.noarch.rpm
--------------- On Fedora 26 ---------------
# wget https://dev.mysql.com/get/mysql80-community-release-fc26-1.noarch.rpm

3। अपने लिनक्स प्लेटफ़ॉर्म के लिए पैकेज डाउनलोड करने के बाद, अब निम्न कमांड के साथ डाउनलोड किए गए पैकेज को स्थापित करें।

--------------- 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 28 ---------------
# dnf localinstall mysql80-community-release-fc28-1.noarch.rpm
--------------- On Fedora 27 ---------------
# dnf localinstall mysql80-community-release-fc27-1.noarch.rpm
--------------- On Fedora 26 ---------------
# yum localinstall mysql80-community-release-fc26-1.noarch.rpm

उपरोक्त इंस्टॉलेशन कमांड सिस्टम की रिपॉजिटरी सूची में MySQL यम रिपॉजिटरी जोड़ता है और संकुल की अखंडता को सत्यापित करने के लिए GnuPG कुंजी डाउनलोड करता है।

4। आप यह सत्यापित कर सकते हैं कि निम्न आदेश का उपयोग करके MySQL यम भंडार सफलतापूर्वक जोड़ा गया है।

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

चरण 2: नवीनतम MySQL संस्करण स्थापित करना

5। निम्न कमांड का उपयोग करके MySQL (वर्तमान में 8.0 ) का नवीनतम संस्करण स्थापित करें।

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

उपरोक्त कमांड MySQL सर्वर के लिए सभी आवश्यक पैकेजों को स्थापित करता है mysql-community-server , mysql-community-client , mysql-समुदाय-आम/मजबूत/और mysql-समुदाय-libs

चरण 3: MySQL रिलीज श्रृंखला स्थापित करना

6। आप MySQL समुदाय सर्वर के विभिन्न उप-रिपॉजिटरी का उपयोग करके अलग-अलग MySQL संस्करण भी स्थापित कर सकते हैं। हाल की MySQL श्रृंखला के लिए उप-रिपॉजिटरी (वर्तमान में MySQL 8.0 ) डिफ़ॉल्ट रूप से सक्रिय है, और अन्य सभी संस्करणों के लिए उप-रिपॉजिटरी (उदाहरण के लिए, MySQL 5.x श्रृंखला) डिफ़ॉल्ट रूप से निष्क्रिय हैं। ।

विशिष्ट उप-रिपॉजिटरी से विशिष्ट संस्करण को स्थापित करने के लिए, आप का उपयोग कर सकते हैं - या - अक्षम करें विकल्प का उपयोग करके yum-config-manager या <। दिखाए गए अनुसार मजबूत> dnf कॉन्फ़िग-मैनेजर :

# 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

चरण 4: MySQL सर्वर शुरू करना

7। MySQL की सफल स्थापना के बाद, निम्नलिखित कमांड के साथ MySQL सर्वर शुरू करने का समय है:

# service mysqld start

आप निम्न आदेश की सहायता से MySQL सर्वर की स्थिति को सत्यापित कर सकते हैं।

# service mysqld status

यह मेरा CentOS 7 बॉक्स के तहत MySQL चलाने का नमूना आउटपुट है।

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। अब अंत में निम्नलिखित कमांड का उपयोग करके स्थापित MySQL संस्करण को सत्यापित करें।

# mysql --version

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

चरण 5: MySQL स्थापना को सुरक्षित करना

9। कमांड mysql_secure_installation आपको रूट पासवर्ड सेट करने, अनाम उपयोगकर्ताओं को हटाने, रूट लॉगिन को हटाने, इत्यादि जैसी महत्वपूर्ण सेटिंग्स करके अपने MySQL स्थापना को सुरक्षित करने की अनुमति देता है।

लाल

Mysql safe कमांड चलाने से पहले पासवर्ड देखने के लिए नीचे दिए गए कमांड का उपयोग करें।

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

एक बार जब आप पासवर्ड जानते हैं तो आप अपने MySQL इंस्टॉलेशन को सुरक्षित करने के लिए कमांड का पालन कर सकते हैं।

# mysql_secure_installation

लाल

अब ऑनस्क्रीन निर्देशों का सावधानीपूर्वक पालन करें, संदर्भ के लिए ऊपर दिए गए कमांड का आउटपुट देखें।

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! 

चरण 6: MySQL सर्वर से कनेक्ट करना

10। उपयोगकर्ता नाम और पासवर्ड प्रदान करके नए स्थापित MySQL सर्वर से कनेक्ट करना।

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

Copyright (c) 2000, 2015, 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>

चरण 7: यम के साथ MySQL को अपडेट करना

11। नए इंस्टॉलेशन के अलावा, आप निम्नलिखित कमांड की मदद से MySQL उत्पादों और घटकों के लिए अपडेट भी कर सकते हैं।

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

जब MySQL के लिए नए अपडेट उपलब्ध होते हैं, तो यह उन्हें ऑटो करेगा, यदि नहीं तो आपको एक संदेश मिलेगा जिसमें कहा जाएगा कि अपडेट के लिए चिह्नित कोई पैकेज नहीं है।

यह आपके सिस्टम पर MySQL 8.0 सफलतापूर्वक स्थापित हो गया है। यदि आपको समाधान के लिए हमारे टिप्पणी अनुभाग का उपयोग करने में कोई परेशानी महसूस हो रही है, तो नि: शुल्क इंस्टॉल करें।