ERROR 1698 (28000): Access denied for user ‘root’@’localhost’

Some systems like Ubuntu, MySQL is using the UNIX auth_socket plugin by default. Basically it means that: db_users using it, will be “authenticated” by the system user credentials. You can see if your root user is set up like this by doing the following: As you can see in the query, the root user is using the auth_socket plugin. There are two ways to solve this: … Read more

“INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”

I would recommend using INSERT…ON DUPLICATE KEY UPDATE. If you use INSERT IGNORE, then the row won’t actually be inserted if it results in a duplicate key. But the statement won’t generate an error. It generates a warning instead. These cases include: Inserting a duplicate key in columns with PRIMARY KEY or UNIQUE constraints. Inserting a NULL into a column with … Read more

Rename a column in MySQL

Use the following query: The RENAME function is used in Oracle databases. @lad2025 mentions it below, but I thought it’d be nice to add what he said. Thank you @lad2025! You can use the RENAME COLUMN in MySQL 8.0 to rename any column you need renamed. ALTER TABLE Syntax: RENAME COLUMN: Can change a column name but not its definition. More … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)