{"id":121,"date":"2019-12-11T17:19:58","date_gmt":"2019-12-11T11:19:58","guid":{"rendered":"https:\/\/goodhost.kz\/wiki\/?p=121"},"modified":"2019-12-12T16:48:57","modified_gmt":"2019-12-12T10:48:57","slug":"%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%ba%d0%b0-mysql-%d0%bd%d0%b0-centos-7","status":"publish","type":"post","link":"https:\/\/goodhost.kz\/wiki\/?p=121","title":{"rendered":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 MySQL \u043d\u0430 Centos 7"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 MySQL \u043d\u0430 Centos 7<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL &#8212; \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0421\u0423\u0411\u0414). \n\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0415\u0435 \u043b\u044e\u0431\u044f\u0442 \u0437\u0430 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0438 \n\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u041e\u0421 \u0442\u0438\u043f\u0430 Redhat \u0438 Centos \u041f\u041e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 yum.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 MySQL \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. \u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 yum makecache.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-preformatted\"><code>yum makecache<\/code><\/pre>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">2. \u041e\u0442\u044b\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 yum list mariadb-server. \u0412 \u0441\u043e\u0441\u0442\u0430\u0432 Centos \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 MariaDb &#8212; \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f MySQL.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum list mariadb-server\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirror.sale-dedic.com\n * epel: fedora.cu.be\n * extras: mirror.sale-dedic.com\n * updates: centos-mirror.rbc.ru\nAvailable Packages\nmariadb-server.x86_64                 1:5.5.56-2.el7                  base # <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0435e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 yum install &lt;\u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430&gt;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>yum install mariadb-server<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u043b\u0443\u0436\u0431\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 systemctl \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0435.<br>\nsystemctl status mysql &#8212; \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 mysql;<br>\nsystemctl start mysql &#8212; \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c mysql;<br>\nsystemctl stop mysql &#8212; \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c mysql;<br>\nsystemctl enable mysql &#8212; \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c mysql \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5. \u041f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c MySQL, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c mysql_secure_installation<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@centos7x64:~# mysql_secure_installation\n\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\n  \tSERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\n\nIn order to log into MariaDB to secure it, we'll need the current\npassword for the root user.  If you've just installed MariaDB, and\nyou haven't set the root password yet, the password will be blank,\nso you should just press enter here.\n\nEnter current password for root (enter for none):\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0423\u0411\u0414 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f root. \u042d\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u041e\u0421, \u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0421\u0423\u0411\u0414. \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Enter &#8212; \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 -\u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">By default, a MariaDB installation has an anonymous user, allowing anyone\nto log into MariaDB without having to have a user account created for\nthem.  This is intended only for testing, and to make the installation\ngo a bit smoother.  You should remove them before moving into a\nproduction environment.\n\nRemove anonymous users? [Y\/n] y\n ... Success!\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c root \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0421\u0423\u0411\u0414.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Disallow root login remotely? [Y\/n] y\n ... Success!\n\nBy default, MariaDB comes with a database named 'test' that anyone can\naccess.  This is also intended only for testing, and should be removed\nbefore moving into a production environment.\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0431\u0430\u0437\u044b, \u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">By default, MariaDB comes with a database named 'test' that anyone can\naccess.  This is also intended only for testing, and should be removed\nbefore moving into a production environment.\n\nRemove test database and access to it? [Y\/n] n\n ... skipping.\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Reload privilege tables now? [Y\/n] y\n ... Success!\n\nCleaning up...\n\nAll done!  If you've completed all of the above steps, your MariaDB\ninstallation should now be secure.\n\nThanks for using MariaDB!\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0421\u0423\u0411\u0414 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 mysql -u root -p.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-u \u043a\u043b\u044e\u0447, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-p \u043a\u043b\u044e\u0447, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0439 \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f. \u0415\u0441\u043b\u0438 \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438, \u044d\u0442\u043e\u0442 \u043a\u043b\u044e\u0447 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@centos7x64:~# mysql -u root\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 6\n\n\nCopyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u043a \u0421\u0423\u0411\u0414. \u041c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0411\u0414 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 show databases;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MariaDB [(none)]&gt; show databases;\n+--------------------+\n| Database       \t|\n+--------------------+\n| information_schema |\n| mysql          \t|\n| performance_schema |\n+--------------------+\n3 rows in set (0.00 sec)\n\nMariaDB [(none)]&gt;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 MySQL \u043d\u0430 Centos 7 MySQL &#8212; \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0421\u0423\u0411\u0414). \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0415\u0435 \u043b\u044e\u0431\u044f\u0442 \u0437\u0430 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u041e\u0421 \u0442\u0438\u043f\u0430 Redhat \u0438 Centos \u041f\u041e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 yum. \u0414\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 MySQL \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. 1. \u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 yum makecache. yum makecache 2. ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/goodhost.kz\/wiki\/?p=121\" title=\"\u0447\u0438\u0442\u0430\u0442\u044c...\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,12],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category---vds-vps","category-h--"],"_links":{"self":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":4,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":168,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions\/168"}],"wp:attachment":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}