Skip to main content
Skip table of contents

Centos 7 Instance Üzerinde MySQL Kurulumu

MySQL açık kaynaklı veritabanı yönetimi sistemidir. İlişkisel bir veritabanıdır ve verileri yönetirken SQL sorgulama dilini kullanır

MySQL'i indirmeden önce sistemimizin güncel olduğundan emin olmamız gerekiyor. Bunun için

CODE
$ sudo yum update 

Sistemimizi güncelledikten sonra mysql-server rpm paketlerini indirmemiz gerekiyor. Bundan sonra tekrar sistemimizi güncelleyip mysql-server i kurabiliriz:

CODE
$ wget http://repo.mysql.com/mysql-community-release-el7-11.noarch.rpm
$ sudo yum update & sudo yum install mysql-server

İndirme süresince karşınıza mysql root kullanıcı için şifre oluşturma ekranı çıkacaktır. Bu ekrandan bir şifre oluşturmanız gerekmektedir.

Kurulum gerçekleştikten sonra mysql servisini başlatmanız gerekiyor:

CODE
$ sudo systemctl start mysqld 

Yükleme işlemi bittikten sonra MySQL'i daha güvenli hale getirmek için güvenlik betiğini başlatmamız gerekiyor.

CODE
$ mysql_secure_installation

Betik çalıştıktan sonra size root şifresini soracaktır. Yükleme sırasında belirlediğiniz root şifresini girmeniz gerekmektedir. Çıkan ekranları aşağıdaki gibi yapabilirsiniz. Daha güçlü şifreler için password validation policy kısmını 2 yapabilirsiniz. Ayrıca kurulum sırasında belirlediğiniz root şifresini değiştirmek istiyorsanız Change the password for root ? kısmın y yapıp yeni bir şifre belirleyebilirsiniz.

CODE
Securing the MySQL server deployment.
Enter password for user root:
ALIDATE 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: 1
Using existing password for root.
Estimated strength of the password: 25 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
... skipping.
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) : n
... skipping.
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!  

Güvenli kurulum işlemi bittikten sonra mysql servisinin çalıştığını kontrol etmeniz gerekmektedir. Aşağıdaki komuttan sonra ekran Active: active(running) ifadesi var ise mysql servisi çalışıyor demektir.

CODE
$ sudo systemctl status mysqld

MySQL i aşağıdaki komut ile test edebilirsiniz:

CODE
$ mysqladmin -u root -p version
Enter password: 
mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
Copyright (c) 2000, 2017, 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.
Server version 5.7.20
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysqld/mysqld.sock
Uptime: 12 min 50 sec
Threads: 1 Questions: 124 Slow queries: 0 Opens: 206 Flush tables: 1 Open tables: 64 Queries per second avg: 0.161

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.