Hot!

Cara Mudah Install Mysql 5.7 di Centos 7


 

Cara Mudah Install Mysql 5.7 di Centos 7


Cara Mudah Install Mysql 5.7 di Centos 7

Mozunote.com saat ini banyk sekali aplikasi-aplikasi bermunculan dan dibuat baik itu oleh individu atau bahkan oleh perusahaan, mulai dari aplikasi mobile ,web atau dekstop banyak sekali yang membutuhkan sistem database server yang baik untuk menunjang aplikasi-aplikasi mereka. Banyak sekali sistem database yang bisa kita gunakan namun dari dulu memang yang umum dan merakyat untuk digunakan adalah mysql.


Sekarang akan kita coba install mysql versi 5.7 untuk dipasnagkan didalam linux centos walalupun sudah ada mysql versi 8 namun versi 5.7 ini masih banyak digunakan karena vitur nya masih pas dengan perkembangan php 7.xx saat ini.


Berikut tahapan yang harus dilakukan;


1. Cara mudah pertama adalah aktifkan dulu repository linux centos untuk mysql 5.7 dengan bantuan yum, berikut contoh code nya bisa kamu gunakan alamt repository berikut;

yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm


<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- iklangooglepanjang --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-2540589963094832" data-ad-slot="3720248778" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

2. Tahapan selanjutnya adalah Install mysql servernya, caranya mudah kita gunakan fasilitas yum ;


yum install mysql-community-server


Install sampai selesai atau complete kemudian Aktifkan Mysql servernya dengan perintah 

service mysqld start


3. Sebelum melangkah ketahapan selanjutnya cek dulu password sementara dari mysql server dengan perintah berikut ;


grep 'A temporary password' /var/log/mysqld.log |tail -1


nanti hasilnya akan keluar seperti code dibawah 

2021-03-30T02:57:10.981502Z 1 [Note] A temporary password is generated for root@localhost: Nm(!pKkkjo68e


Simpan code password sementara tersebut untuk tahapan selanjutnya


4. Konfigurasi Mysql, sebelum bisa digunakan kita konfigurasi mysql server agar bisa digunakan dengan baik ikuti wizard nya dengan perintah 

/usr/bin/mysql_secure_installation


Berikut Contoh Wizard dari konfigurasi awal mysql


Securing the MySQL server deployment.

Enter password for user root: **********

The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.

Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: ******************

Re-enter new password: ******************

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
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) : N
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!


Dengan demikian selesailah instalasi Mysql server di linux centos, untuk test login bisa kamu masukan perintah 

mysql -h localhost -u root -p 


Jika kamu ingin mudah untuk memanage mysql bisa gunakan phpmyadmin cara instalasinya sangat mudah, akan kita bahas diartikel selanjutnya.


sekian semoga bermanfaat.



Banner IDwebhost
Comments
0 Comments

0 comments:

Post a Comment