Mengatasi MYSQL ERROR 1045 (28000)

14 Oct

Mengatasi MYSQL ERROR 1045 (28000)

#ERROR 1045 (28000): Access denied for user ‘root’@’
#ERROR 1045 (28000)
#Access denied for user ‘root’@’

===========================================================
KASUS :
A. SERVER MYSQL : 172.20.35.11
B. CLIENT MYSQL : 172.20.33.42
===========================================================
DARI CLIENT MYSQL : 172.20.33.42
===========================================================
[root@ubsweb ~]# mysql -u root -h 172.20.35.11 -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@’172.20.33.42’ (using password: YES)

===========================================================
DARI SERVER MYSQL : 172.20.35.11
===========================================================
pi@turnstile1 ~ $ mysql -u root -p
Enter password:
mysql> USE akses_masuk;
mysql> CREATE USER ‘root’@’172.20.33.42’ IDENTIFIED BY ‘xxxxxxxxxxxxx’;
ERROR 1396 (HY000): Operation CREATE USER failed for ‘root’@’172.20.33.42’

mysql>  SELECT user, host FROM mysql.user;
+——————+————–+
| user             | host         |
+——————+————–+
| root             | 127.0.0.1    |
| root             | 172.20.35.11 |
| root             | 172.20.35.12 |
| root             | 172.20.35.13 |
| root             | 172.20.35.14 |
| root             | 172.20.35.15 |
| root             | 172.20.35.31 |
| root             | 172.20.75.17 |
| root             | ::1          |
| debian-sys-maint | localhost    |
| pi               | localhost    |
| root             | localhost    |
+——————+————–+

mysql> drop user root@172.20.33.42;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE USER ‘root’@’172.20.33.42’ IDENTIFIED BY ‘xxxxxxxxxxxxx’;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON akses_masuk.* TO ‘root’@’172.20.33.42’;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT user, host FROM mysql.user;
+——————+————–+
| user             | host         |
+——————+————–+
| root             | 127.0.0.1    |
| root             | 172.20.33.42 |
| root             | 172.20.35.11 |
| root             | 172.20.35.12 |
| root             | 172.20.35.13 |
| root             | 172.20.35.14 |
| root             | 172.20.35.15 |
| root             | 172.20.35.31 |
| root             | 172.20.75.17 |
| root             | ::1          |
| debian-sys-maint | localhost    |
| pi               | localhost    |
| root             | localhost    |
+——————+————–+
17 rows in set (0.01 sec)

mysql> quit
Bye

===========================================================
DARI CLIENT MYSQL : 172.20.33.42
===========================================================
[root@ubsweb ~]# mysql -u root -h 172.20.35.11 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 99
Server version: 5.5.41-0+wheezy1 (Debian)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use akses_masuk;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> quit
Bye

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

%d bloggers like this: