Error yang muncul

● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: active (running) since Fri 2016-11-25 23:37:14 WIB; 2min 6s ago
  Process: 31020 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Process: 31049 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mysql.service
           ├─31077 /bin/sh /usr/bin/mysqld_safe
           └─31437 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pi...
 
Nov 25 23:37:14 load-balancing mysql[31049]: Starting MySQL database server: mysqld ..
Nov 25 23:37:14 load-balancing mysql[31049]: Checking for tables which need an upgrade, are corrupt or were
Nov 25 23:37:14 load-balancing mysql[31049]: not closed cleanly..
Nov 25 23:37:14 load-balancing systemd[1]: Started LSB: Start and stop the mysql database server daemon.
Nov 25 23:37:14 load-balancing /etc/mysql/debian-start[31495]: Upgrading MySQL tables if necessary.
Nov 25 23:37:14 load-balancing /etc/mysql/debian-start[31514]: Checking for insecure root accounts.
Nov 25 23:37:14 load-balancing mysql[31049]: ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

Error tersebut karena user bawaan Debian debian-sys-maint ngga bisa login ke MySQL/MariaDB.

Solusi

Cek password yang saat ini digunakan debian-sys-maint

cat /etc/mysql/debian.cnf
### output
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = kjIsdaf1248FGq5HA
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = kjIsdaf1248FGq5HA
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

lihat di bagian password, selanjutnya login ke MySQL sebagai root

mysql -u root -p

dan berikan akses penuh ke user debian-sys-maint

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'kjIsdaf1248FGq5HA';

Sampai disini sudah selesai. Untuk melihat log MySQL Debian, cek /var/log/mysql/error.log

Leave a comment

Your email address will not be published. Required fields are marked *