Android

Paano i-install ang mysql sa debian 10 linux

How To Install the Latest MySQL on Debian 10 (Buster)

How To Install the Latest MySQL on Debian 10 (Buster)

Talaan ng mga Nilalaman:

Anonim

Ang MySQL, ang pinakatanyag sa buong mundo ng open source relational database management system ay hindi magagamit sa mga default na repositories ng Debian. Ang MariaDB ay ang default na sistema ng database sa Debian 10.

Ang tutorial na ito, nagpapaliwanag kung paano i-install at secure ang MySQL sa Debian 10 mula sa MySQL Apt Repository.

Pag-configure ng MySQL Repository

Upang magdagdag ng reporter ng MySQL APT sa iyong system pumunta sa pahina ng pag-download ng repository at i-download ang pinakabagong package ng paglabas gamit ang sumusunod na utos ng wget:

wget

Kapag nakumpleto ang pag-download i-install ang pakete ng paglabas bilang isang gumagamit na may mga pribilehiyo sudo:

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

Ipakita sa iyo ang menu ng pagsasaayos mula sa kung saan maaari mong piliin ang bersyon ng MySQL na nais mong mai-install.

Kapag nakumpleto ang pag-install, awtomatikong magsisimula ang serbisyo ng MySQL, maaari mo itong i-verify sa pamamagitan ng pag-type:

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…

Pagse-secure ng MySQL

Patakbuhin ang utos mysql_secure_installation upang itakda ang root password at upang mapabuti ang seguridad ng pag-install ng MySQL:

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:

Hihilingin sa iyo na i-configure ang VALIDATE PASSWORD PLUGIN na ginagamit upang masubukan ang lakas ng mga password ng MySQL mga gumagamit. Mayroong tatlong mga antas ng patakaran sa pagpapatunay ng password, mababa, katamtaman at malakas. Pindutin ang ENTER kung hindi mo nais na mai-set up ang patunayan ang plugin ng password.

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

Sa susunod na prompt, hihilingin sa iyo na magtakda ng isang password para sa MySQL root user.

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!

Sa sandaling naitakda mo ang root password ay hihilingin din sa iyo ng script na alisin ang hindi nagpapakilalang gumagamit, higpitan ang pag-access sa ugat sa lokal na makina at alisin ang test database. Dapat mong sagutin ang "Y" (oo) sa lahat ng mga katanungan.

Pagkonekta sa MySQL Server

Upang makipag-ugnay sa MySQL sa pamamagitan ng terminal, gamitin ang mysql client na naka-install bilang isang dependency ng package ng MySQL server.

Kung pinili mo ang default na paraan ng pagpapatunay upang mag-log in sa MySQL server bilang uri ng ugat ng gumagamit:

sudo mysql

Kung hindi, kung pinili mo ang paraan ng pagpapatunay ng legacy upang mag-log in ng uri:

mysql -u root -p

mysql_secure_installation ka upang ipasok ang root password na dati mong naitakda nang mysql_secure_installation ang mysql_secure_installation script. Kapag naipasok mo ang password ay bibigyan ka ng MySQL shell tulad ng ipinakita sa ibaba:

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…

Konklusyon

Sa tutorial na ito, nalaman mo kung paano i-install at mai-secure ang isang MySQL server sa isang Debian 10 server. Ipinakita namin sa iyo kung paano kumonekta sa shell ng MySQL.

Kung ang iyong aplikasyon ay walang anumang mga tukoy na kinakailangan, dapat kang dumikit sa MariaDB, ang default na database system sa Debian 10.

mysql debian