Centos üzerine MySql Kurulumu

Centos üzerine MySql Kurmak için yapmanız gerekenler,

Öncelikle SSH komut satırına girmek gerekiyor :)

1. # yum install mysql*
Çıkan sorulara yes diyerek devam ediyoruz.

2. # chkconfig –levels 235 mysqld on
Sunucuyu yeniden başlattıktan (reboot) sonra MySql’in otomatik olarak başlaması için gerekli.

3. # /etc/init.d/mysqld start
MySql’i başlatıyoruz.

4. # netstat -tap | grep mysql
MySql’in çalışıp çalışmadığınını kontrol ediyoruz. Aşağıdaki gibi bir çıktı veriyorsa sorun yok demektir.
[root@localhost ~]# netstat -tap | grep mysql
tcp        0      0 *:mysql                     *:*                         LISTEN      4966/mysqld

Eğer MySql’i başlatırken aşağıdaki gibi bir hata alırsanız /etc/hosts dosyanızı düzenlemeniz gerekiyor.

[root@localhost ~]# /etc/init.d/mysqld start
Initializing MySQL database:  Neither host ‘deneme.hostavrupa.net’ nor ‘localhost’ could be looked up with /usr/bin/resolveip
Please configure the ‘hostname’ command to return a correct hostname.
If you want to solve this at a later stage, restart this script with the –force option
[FAILED]

Örnek /etc/hosts dosya içeriği

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
111.111.111.111            deneme.halilzade.com deneme

Unutmadan MySql’de root kullanıcısına şifre veriyoruz,

5. # mysqladmin -u root password sifreburayagelecek

Ek olarak aşağıdaki komut ile temel güvenlik ayarlarını yapabilirsiniz.

#mysql_secure_installation

Emir HALİLZADE

VPS Hosting