In MySQL SERVER 8.0 the PASSWORD function not working

If you need a replacement hash to match the password() function, use this: SHA1(UNHEX(SHA1())); E.g. mysql> SELECT PASSWORD(‘mypass’); +——————————————-+ | PASSWORD(‘mypass’) | +——————————————-+ | *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 | +——————————————-+ and replacement that gives the same answer in version 8: mysql> SELECT CONCAT(‘*’, UPPER(SHA1(UNHEX(SHA1(‘mypass’))))); +————————————————-+ | CONCAT(‘*’, UPPER(SHA1(UNHEX(SHA1(‘mypass’))))) | +————————————————-+ | *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 | +————————————————-+

MySQL bulk INSERT or UPDATE

You can insert/update multiple rows using INSERT … ON DUPLICATE KEY UPDATE. The documentation has the following example: INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6) ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b); Or am I misunderstanding your question?

Error Code: 1822. Failed to add the foreign key constaint. Missing index for constraint

create_user INT UNSIGNED ZEROFILL cannot reference id INT, because these count as different data types for purposes of foreign key reference. Make them the same data type. The only data type difference that is permitted between columns in a foreign key relationship is length of a varchar. For example, VARCHAR(10) can reference VARCHAR(20) or vice-versa. … Read more

MySql SELECT union for different columns? [duplicate]

If you have different fields that have different meaning too, you can’t and shouldn’t return them in the same position. You can however ‘fill in the blanks’ by adding null to your fields, like this: select id, name, date, null as userid, ‘A’ as recordtype from table1 union all select id, name, null /*as date*/, … Read more

techhipbettruvabetnorabahisbahis forumu