PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 4, 2022

[FIXED] How to check if user password is set in mysql?

 September 04, 2022     authentication, mysql     No comments   

Issue

I need to run automated checks against new servers. One of those checks is to detect if user (or root) password is set or not. But..

mysql> SELECT host, user, password FROM mysql.user;
ERROR 1054 (42S22): Unknown column 'password' in 'field list'

Server version: 5.7.18-0ubuntu0.17.04.1 (Ubuntu)


Solution

MySQL versions 5.7 or higher doesnt have a column named password in mysql.user table. MySQL versions 5.7 or higher use the column authentication_string instead.

So you query should be:

SELECT host, user, authentication_string FROM mysql.user


Answered By - Raymond Nijland
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing