MySQL Allows blank user with no password to login

I just realized I have some blank users which I deleted but I can still login to this dummy account without a password for some reason.

 

mysql -u -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.69 Source distribution

Copyright (c) 2000, 2013, 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>

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select user()
    -> ;
+--------------+
| user()       |
+--------------+
| -p@localhost |
+--------------+
1 row in set (0.00 sec)


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.00 sec)



mysql> select User from user;
+-----------------+
| User            |
+-----------------+
| root            |
|                 |
| root            |
|                 |
| root            |
+-----------------+
6 rows in set (0.00 sec)

mysql> delete from mysql where User='';
ERROR 1146 (42S02): Table 'mysql.mysql' doesn't exist
mysql> delete from user where User='';
Query OK, 2 rows affected (0.00 sec)

mysql> select User from user;
+-----------------+
| User            |
+-----------------+
| root            |
| root            |
| root            |
+-----------------+
4 rows in set (0.00 sec)


Tags:

mysql, allows, user, password, logini, users, deleted, login, dummy, commands, server, copyright, oracle, affiliates, reserved, registered, trademark, corporation, trademarks, respective, owners, input, select, localhost, databases, database, information_schema, rows, delete, doesn, query, ok,

Latest Articles

  • CentOS 6 and 7 / RHEL Persistent DHCP Solution
  • Debian Ubuntu Mint rc-local service startup error solution rc-local.service: Failed at step EXEC spawning /etc/rc.local: Exec format error
  • MySQL Cheatsheet Guide and Tutorial
  • bash script kill whois or other command that is running for too long
  • Linux tftp listens on all interfaces and IPs by DEFAULT Security Risk Hole Solution
  • python import docx error
  • Cisco Unified Communications Manager Express Cheatsheet CUCME CME
  • Linux Ubuntu Debian Missing privilege separation directory: /var/run/sshd
  • bash how to count the number of columns or words in a line
  • bash if statement how to test program output without assigning to variable
  • RTNETLINK answers: Network is unreachable
  • Centos 7 how to save iptables rules like Centos 6
  • nfs tuning maximum amount of connections
  • qemu-kvm error "Could not initialize SDL(No available video device) - exiting"
  • Centos 7 tftpd will not work with selinux enabled
  • Debian Ubuntu Mint Howto Create Bridge (br0)
  • How To Control Interface that dhcpd server listens to on Debian based Linux like Mint and Ubuntu
  • LUKS unable to type password to unlock during boot on Debian, Ubuntu and Mint
  • Debian Ubuntu and Linux Mint Broken Kernel After Date - New Extra Module Naming Convention
  • Wordpress overwrites and wipes out custom htaccess rules and changes soluton