How do I import an SQL file using the command line in MySQL?

Try: Check MySQL Options. Note 1: It is better to use the full path of the SQL file file.sql. Note 2: Use -R and –triggers to keep the routines and triggers of original database. They are not copied by default. Note 3 You may have to create the (empty) database from MySQL if it doesn’t exist already and the exported SQL don’t contain CREATE DATABASE (exported … Read more

Not unique table/alias

Your query contains columns which could be present with the same name in more than one table you are referencing, hence the not unique error. It’s best if you make the references explicit and/or use table aliases when joining. Try

Installation of MySQL for Visual Studio 1.2.8 failed

Today I’ve encountered a similar error. In my case I couldn’t uninstall mysql-visualstudio-plugin-1.1.1.msi. Also had MySQL Connector Net 6.7.4 + 6.8.3 installed before (and more stuff which give and gave me many errors to solve manually). Before doing machine.config replacement as described below, first make a backup or rename them, of course. Modified versions of … Read more

MySQL root password change

I found it! I forgot to hash the password when I changed it. I used this query to solve my problem: update user set password=PASSWORD(‘NEW PASSWORD’) where user=’root’; I forgot the PASSWORD(‘NEW PASSWORD’) and just put in the new password in plain text.

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