एंड्रॉयड

डेबियन 10 लिनक्स पर mysql कैसे स्थापित करें

Contain Yourself: An Intro to Docker and Containers by Nicola Kabar and Mano Marks

Contain Yourself: An Intro to Docker and Containers by Nicola Kabar and Mano Marks

विषयसूची:

Anonim

MySQL, दुनिया का सबसे लोकप्रिय ओपन सोर्स रिलेशनल डेटाबेस मैनेजमेंट सिस्टम डिफ़ॉल्ट डेबियन के रिपॉजिटरी में उपलब्ध नहीं है। डेबियन 10 में मारियाडीबी डिफ़ॉल्ट डेटाबेस सिस्टम है।

यह ट्यूटोरियल बताता है कि MySQL एप रिपॉजिटरी से डेबियन 10 पर MySQL को कैसे स्थापित और सुरक्षित किया जाए।

MySQL रिपॉजिटरी को कॉन्फ़िगर करना

अपने सिस्टम में MySQL APT रिपॉजिटरी को जोड़ने के लिए रिपॉजिटरी डाउनलोड पेज पर जाएं और निम्न रिलीज कमांड का उपयोग करके नवीनतम रिलीज़ पैकेज डाउनलोड करें:

wget

एक बार डाउनलोड पूरा होने के बाद sudo विशेषाधिकार वाले उपयोगकर्ता के रूप में रिलीज़ पैकेज स्थापित करें:

sudo apt install./mysql-apt-config_0.8.13-1_all.deb

आपको कॉन्फ़िगरेशन मेनू के साथ प्रस्तुत किया जाएगा जहां से आप उस MySQL संस्करण का चयन कर सकते हैं जिसे आप इंस्टॉल करना चाहते हैं।

एक बार स्थापना पूर्ण हो जाने के बाद, MySQL सेवा अपने आप शुरू हो जाएगी, आप इसे टाइप करके सत्यापित कर सकते हैं:

sudo systemctl status mysql

● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en Active: active (running) since Fri 2019-07-26 13:23:25 PDT; 37s ago…

MySQL को सुरक्षित करना

रूट पासवर्ड सेट करने और MySQL स्थापना की सुरक्षा को बेहतर बनाने के लिए mysql_secure_installation कमांड चलाएं:

sudo mysql_secure_installation

Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT 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 component? Press y|Y for Yes, any other key for No:

आपको VALIDATE PASSWORD PLUGIN को कॉन्फ़िगर करने के लिए कहा जाएगा जिसका उपयोग MySQL उपयोगकर्ताओं के पासवर्ड की ताकत का परीक्षण करने के लिए किया जाता है। पासवर्ड सत्यापन नीति के तीन स्तर हैं, निम्न, मध्यम और मजबूत। यदि आप मान्य पासवर्ड प्लगइन सेट नहीं करना चाहते हैं तो ENTER

Please set the password for root here. New password: Re-enter new password:

अगले संकेत पर, आपको MySQL रूट उपयोगकर्ता के लिए एक पासवर्ड सेट करने के लिए कहा जाएगा।

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!

एक बार जब आप रूट पासवर्ड सेट करते हैं तो स्क्रिप्ट आपको अनाम उपयोगकर्ता को हटाने, रूट उपयोगकर्ता को स्थानीय मशीन तक सीमित करने और परीक्षण डेटाबेस को हटाने के लिए भी कहेगी। आपको सभी प्रश्नों का उत्तर "Y" (हां) में देना चाहिए।

MySQL सर्वर से कनेक्ट करना

टर्मिनल के माध्यम से MySQL के साथ बातचीत करने के लिए, mysql क्लाइंट का उपयोग करें जो MySQL सर्वर पैकेज की निर्भरता के रूप में स्थापित है।

यदि आपने मूल उपयोगकर्ता प्रकार के रूप में MySQL सर्वर में लॉग इन करने के लिए डिफ़ॉल्ट प्रमाणीकरण विधि का चयन किया है:

sudo mysql

अन्यथा, यदि आपने टाइप करने के लिए विरासत प्रमाणीकरण विधि का चयन किया है:

mysql -u root -p

जब आपने पहले mysql_secure_installation स्क्रिप्ट चलाई थी, तो आपको रूट पासवर्ड दर्ज करने के लिए कहा जाएगा। एक बार पासवर्ड दर्ज करने के बाद आपको MySQL शेल के साथ प्रस्तुत किया जाएगा जैसा कि नीचे दिखाया गया है:

Welcome to the MySQL monitor. Commands end with; or \g. Your MySQL connection id is 10 Server version: 8.0.17 MySQL Community Server - GPL…

निष्कर्ष

इस ट्यूटोरियल में, आपने सीखा है कि डेबियन 10 सर्वर पर MySQL सर्वर को कैसे इंस्टॉल और सुरक्षित किया जाए। हमने आपको MySQL शेल से कनेक्ट करने का तरीका भी दिखाया है।

यदि आपके आवेदन में कोई विशेष आवश्यकता नहीं है, तो आपको डेबियन 10 में डिफ़ॉल्ट डेटाबेस सिस्टम मारियाडीबी के साथ रहना चाहिए।

mysql डेबियन