Setelah saya install paket Web Server & LAMP Server, saya mengalami kesulitan untuk mengakses database mysql. Setelah ditelusur ternyata, konfigurasi mysql di openSUSE dan distro yang biasa saya pakai memang ada bedanya. Jika di distro biasanya saya install mysql langsung diminta untuk memasukkan password mysql, nah disini beda. Yang biasanya service itu langsung jalan, ini nggak langsung jalan. Intinya Install ya install saja, tahu-tahu selesai. Hebat kan? OpenSUSE gitu, nah bingung deh mo ngapain ini.
Selesai instalasi saya mengecek apakah mysqld sudah jalan atau belum dengan
langsung saya jalankan di console
Ingat, password jangan disebarkan ke orang lain ya, yang bukan admin... :D
Coba deh, jalankan mysql-nya dengan "mysql -u root -p". Kalau password yang tadi dimasukkan dapat dibaca oleh sistem, berarti sudah sukses untuk konfigurasi database mysql.
Referensi:
http://en.opensuse.org/SDB:MySQL_installation
Selesai instalasi saya mengecek apakah mysqld sudah jalan atau belum dengan
linux-1hja:~ # rcmysql statusNah lo "Active: inactive(dead)", ini menandakan bahwa service mysql belum dijalankan. Oke deh,
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: inactive (dead)
CGroup: name=systemd:/system/mysql.service
langsung saya jalankan di console
linux-1hja:~ # rcmysql startSetelah itu, secara default, password root mysql adalah blank. Untuk konfigurasi keamanan mysql, kita menggunakan perintah mysql_secure_installation.
redirecting to systemctl
linux-1hja:~# rcmysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: active (running) since Sat, 29 Sep 2012 08:02:07 +0700; 46min ago
Process: 4221 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/mysql.service
├ 4319 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --user=mysql --pid-file=/var/run/mysql/mysqld.pid -...
└ 4644 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --...
Sep 29 08:02:04 linux-1hja.site mysql[4221]: /usr/bin/mysql_secure_installation
Sep 29 08:02:04 linux-1hja.site mysql[4221]: which will also give you the option of removing the test
Sep 29 08:02:04 linux-1hja.site mysql[4221]: databases and anonymous user created by default. This is
Sep 29 08:02:04 linux-1hja.site mysql[4221]: strongly recommended for production servers.
Sep 29 08:02:04 linux-1hja.site mysql[4221]: See the manual for more instructions.
Sep 29 08:02:04 linux-1hja.site mysql[4221]: You can start the MySQL daemon with:
Sep 29 08:02:04 linux-1hja.site mysql[4221]: rcmysql start
Sep 29 08:02:04 linux-1hja.site mysql[4221]: You can test the MySQL daemon with mysql-test package
Sep 29 08:02:04 linux-1hja.site mysql[4221]: Please report any problems with the /usr/bin/mysqlbug script!
Sep 29 08:02:07 linux-1hja.site mysql[4221]: Starting service MySQL ..done
#mysql_secure_installationlangsung saja ikuti yang penting-penting saja ya....
Set root password? [Y/n] Yurutan diatas adalah pertanyaan apakah akan diset password root untuk mysql? tinggal pilih [Y/n]. Seyogyanya pilih Y supaya aman. Setelah itu diminta untuk memasukkan password baru dan setelah tekan enter diminta memasukkan password yang sama, kemudian enter. mudah bukan?
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyoneOpsi diatas, menanyakan apakah user anonymous akan dihapus. Sarannya adalah dihapus demi keamanan data anda.
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? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. ThisOpsi ini, menanyakan hak akses dari database mysql. Boleh tidak diakses pada jaringan. Kalau boleh ya pilih n kalau tidak pilih Y. Demi amannya, pilih yes. jadi kalau mau mainan mysql ya langsung pakai servernya itu sendiri. :D
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... skipping.
By default, MySQL comes with a database named 'test' that anyone canBawaannya mysql kan ada database test tuch, itu gunanya untuk testing terhadap MySQL tersebut. Sebaiknya dihapus, karena memang tidak terpakai. Jangan-jangan bisa menjadi hole keamanan. Hehehehe....
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? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so farSystem akan me-load hak istimewa terhadap database yang ada didalamnya, pilih saja Y karena biar user dapat mengakses database yang ada didalamnya secara penuh. Dan akhirnya MySQL berjalan sudah aman dengan password baru kita.
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Ingat, password jangan disebarkan ke orang lain ya, yang bukan admin... :D
Coba deh, jalankan mysql-nya dengan "mysql -u root -p". Kalau password yang tadi dimasukkan dapat dibaca oleh sistem, berarti sudah sukses untuk konfigurasi database mysql.
http://en.opensuse.org/SDB:MySQL_installation
Comments
Post a Comment