Kemudian Ana mencoba dengan beberapa perintah di terminal:
sudo /etc/init.d/mysql stop
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
ana ketikan sudo phpmysql -u root
muncul error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
penyelesaian :
ketikan di terminal sudo /etc/init.d/mysql start
kemudian ana coba lagi ketikan beberapa perintah
sudo mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: NO)
sudo mysql -u root
-p
ERROR 1045 (28000): Access denied for user 'root'@'localhost'
(using password: YES)
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt install mysql-server
errornya balik lagi ke awal #1698-access denied for user 'root@'localhost''.
Ana coba lagi
sudo service mysql stop
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
kemudian muncul error "Connection for controluser as defined in your configuration failed"
penyelesaian :
sudo gedit /etc/phpmyadmin/config.inc.php
kemudian cari //$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
hilangkan // dari script $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
kemudian simpan maka akan muncul seperti gambar dibawah ini, denga penambahan field didalamnya "server choice"
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
mysql -u root maka akan muncl error :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[5] Exit 1 sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking
ketika menggunakan sudo mysql -u root tetap error :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ketika ketik sudo service mysql start
kemudian sudo mysql -u root maka berhasil
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.23-0ubuntu0.18.04.1 (Ubuntu)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Mysql> ketikan FLUSH PRIVILEGES;
Mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('password anda');
doneee
Jangan lelah mencoba!!
Referensi :
https://askubuntu.com/questions/156280/1045-cannot-log-in-to-the-mysql-server
atau bisa menggunakan alternatif : https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost
0 komentar:
Posting Komentar