MySQL – ERROR 1045 – Access denied

If you actually have set a root password and you’ve just lost/forgotten it: Stop MySQL Restart it manually with the skip-grant-tables option: mysqld_safe –skip-grant-tables Now, open a new terminal window and run the MySQL client: mysql -u root Reset the root password manually with this MySQL command: UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=”root”; If you … Read more

Disable drop paste in HTML input fields? [duplicate]

You can disable paste in your input as follows: html: <input type=”text” value=”” id=”myInput”> javascript: window.onload = () => { const myInput = document.getElementById(‘myInput’); myInput.onpaste = e => e.preventDefault(); } Talking about security, I wouldn’t say that this makes any impact. You would usually use client side and well as server-side validation of data submitted … Read more

JOptionPane to get password

Yes, it is possible using JOptionPane.showOptionDialog(). Something like this: JPanel panel = new JPanel(); JLabel label = new JLabel(“Enter a password:”); JPasswordField pass = new JPasswordField(10); panel.add(label); panel.add(pass); String[] options = new String[]{“OK”, “Cancel”}; int option = JOptionPane.showOptionDialog(null, panel, “The title”, JOptionPane.NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[1]); if(option == 0) // pressing OK button { char[] … Read more

Node.js hashing of passwords

I use the follwing code to salt and hash passwords. var bcrypt = require(‘bcrypt’); exports.cryptPassword = function(password, callback) { bcrypt.genSalt(10, function(err, salt) { if (err) return callback(err); bcrypt.hash(password, salt, function(err, hash) { return callback(err, hash); }); }); }; exports.comparePassword = function(plainPass, hashword, callback) { bcrypt.compare(plainPass, hashword, function(err, isPasswordMatch) { return err == null ? callback(null, … Read more

Password strength checking library [closed]

Have a look at vt-password: configurable, allowing the deployer to supply different dictionaries, adjust weights of different criteria, and so on – Partially (yes to configurable, dictionaries, no to weighted criteria) extensible allowing new criteria to be implemented if required – Yes implemented in pure Java – Yes (and decent javadoc) not fundamentally intertwined with … Read more

How to find out the username and password for mysql database

Go to this file in: WampFolder\apps\phpmyadmin[phpmyadmin version]\config.inc.php Usually wamp is in your main hard drive folder C:\wamp\ You will see something like: $cfg[‘Servers’][$i][‘user’] = ‘YOUR USER NAME IS HERE’; $cfg[‘Servers’][$i][‘password’] = ‘AND YOU PASSWORD IS HERE’; Try using the password and username that you have on that file.