Difference between revisions of "Apache dan MySQL"

From belajarwiki
Jump to navigation Jump to search
Line 31: Line 31:
  
 
===Jika lupa password===
 
===Jika lupa password===
 +
Untuk versi
 
   /etc/init.d/mysql stop
 
   /etc/init.d/mysql stop
 
   mysqld_safe --skip-grant-tables &
 
   mysqld_safe --skip-grant-tables &
Line 47: Line 48:
 
Isi
 
Isi
 
   ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<isikan password baru>';
 
   ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<isikan password baru>';
 +
 +
JIKA ERROR
 +
mysql>flush privileges;
 +
mysql>use mysql;
 +
mysql>ALTER USER  'root'@'localhost' IDENTIFIED BY '(YOUR NEW PASSWORD)';
 +
mysql>quit;
 +
 +
sudo killall -u mysql
 +
sudo systemctl restart mysql.service
  
 
   
 
   
Line 53: Line 63:
 
* https://en.wikipedia.org/wiki/MySQL
 
* https://en.wikipedia.org/wiki/MySQL
 
* http://javaatpoint.com/solved-failed-error-set-password-has-no-significance-for-user-rootlocalhost-as-the-authentication-method-used-doesnt-store-authentication-data-in-the-mysql-server-please-consider-using/
 
* http://javaatpoint.com/solved-failed-error-set-password-has-no-significance-for-user-rootlocalhost-as-the-authentication-method-used-doesnt-store-authentication-data-in-the-mysql-server-please-consider-using/
 +
* https://techvblogs.com/blog/how-to-reset-mysql-root-password-ubuntu
  
 
===Pranala Menarik===
 
===Pranala Menarik===
 
* [[Web server]]
 
* [[Web server]]
 
* [[MySQL]]
 
* [[MySQL]]

Revision as of 09:12, 17 March 2023

The Apache HTTP Server, colloquially called Apache, is a free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation. MySQL is an open-source relational database management system. Its name is a combination of "My", the name of co-founder Michael Widenius's daughter, and "SQL", the abbreviation for Structured Query Language. A relational database organizes data into one or more data tables in which data types may be related to each other; these relations help structure the data.

Instalasi

Apache2

  sudo apt install apache2

PHP

  sudo apt install php php-curl php-xml libapache2-mod-php php-mysql php-mbstring php-soap php-fpm

MySQL

  sudo apt install mysql-server mysql-client
  sudo mysql_secure_installation

Jika terdapat error

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '<isikan password>';

Setting Awal

  sudo mysql -u root -p
  SELECT user, authentication_string, plugin, host FROM mysql.user;
  ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<isikan password>';
  FLUSH PRIVILEGES;


Jika folder tidak ada:

  mkdir -p /var/run/mysqld
  chown mysql:mysql /var/run/mysqld


Jika lupa password

Untuk versi

  /etc/init.d/mysql stop
  mysqld_safe --skip-grant-tables &

Buka terminal lain, lalu ketik

  mysql -u root

Jika terdapat error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld

Kosongkan password

  UPDATE user set authentication_string= where user='root';
  FLUSH PRIVILEGES;

Isi

  ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<isikan password baru>';

JIKA ERROR

mysql>flush privileges;
mysql>use mysql;
mysql>ALTER USER  'root'@'localhost' IDENTIFIED BY '(YOUR NEW PASSWORD)';
mysql>quit;
sudo killall -u mysql
sudo systemctl restart mysql.service


Referensi

Pranala Menarik