Posted by: M'Creative | 9 August 2011

Error No. 1045: Connection denied for ‘bloon@1.1.1.1’ (using password: YES)


Palangka, 10 Ramadhan 1423H

Error No. 1045: Connection denied for ‘someuser@somehost’ (using password: YES/NO)

Penyebab

1. User tersebut tidak ada

2. User tidak mempunyai akses dari host tersebut

3. Password salah

Pemecahan

1. Masuk MySql sebagai root di server

bloon@ubuntu:~$ mysql -h localhost -u root -p

atau

bloon@ubuntu:~$ mysql -h 127.0.0.1 -u root -p

2. Cek user

mysql>SELECT host,user FROM mysql.user;

+———–+——————+
| host      | user             |
+———–+——————+
| %         | bloon            |
| 127.0.0.1 | root             |
| djafa     | root             |
| localhost | debian-sys-maint |
| localhost | root             |
+———–+——————+
5 rows in set (0.00 sec)

Bisa dilihat user ‘bloon’ ada, dan mempunyai akses ‘%’, artinya bisa diakses dari mana saja, dilocal maupun remote

3. Ganti Password

mysql>UPDATE mysql.user SET password = PASSWORD(‘newpassword’) where host=’%’  and user=’bloon’;

Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql>FLUSH PRIVILEGES

Query OK, 0 rows affected (0.00 sec)

4. Tes user dari local maupun remote

5. Jika masih error no.1045,, kalau tidak mau ambil pusing, lebih baik hapus user lama dan buat user baru

mysql>DELETE FROM mysql.user WHERE host=’%’ AND user =’bloon’;

Query OK, 1 row affected (0.00 sec)

6. Buat user baru https://palawa.wordpress.com/2011/08/05/adding-mysql-user/

Sampai di sini seharusnya sudah tidak ada masalah, baik dari local maupun via remote


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: