How to auto login in MySQL from a shell script?

Alternative ways to write these options. You can write mysql -u “$MYSQL_ROOT” -p”$MYSQL_PASS” -e “SHOW DATABASES” If [password is] given, there must be no space between –password= or -p and the password following it. If no password option is specified, the default is to send no password. to pass empty strings as separate arguments. Your … Read more

MySQL: check what version : 32 bit or 64 bit?

$ mysql –version mysql Ver 14.14 Distrib 5.1.45, for apple-darwin10.2.0 (i386) using readline 6.2 $ echo ‘\s’ | mysql ————– mysql Ver 14.14 Distrib 5.1.45, for apple-darwin10.2.0 (i386) using readline 6.2 Connection id: 105730 […] Server version: 5.1.41 MySQL Community Server (GPL) […] Uptime: 11 days 4 hours 2 min 6 sec Threads: 2 Questions: … Read more

Why to use foreign keys with no action on delete or update

I think you’re misunderstanding what ON DELETE NO ACTION means. It does not mean to suppress the foreign-key constraint. When you delete a record that is referred to by a foreign key, InnoDB has the ability to take an automatic action to rectify the situation: it can CASCADE, meaning, delete the referring record. (This would … Read more

When to use a left outer join?

Joins are used to combine two related tables together. In your example, you can combine the Employee table and the Department table, like so: SELECT FNAME, LNAME, DNAME FROM EMPLOYEE INNER JOIN DEPARTMENT ON EMPLOYEE.DNO=DEPARTMENT.DNUMBER This would result in a recordset like: FNAME LNAME DNAME —– —– —– John Smith Research John Doe Administration I … Read more

Laravel migration (errno: 150 “Foreign key constraint is incorrectly formed”)

Since increments() creates an unsigned integer column, you need to define the foreign key column as unsigned integer too. Default migrations in Laravel 6+ use bigIncrements(), so you need to use unsignedBigInteger() method: $table->unsignedBigInteger(‘order_id’); https://laravel.com/docs/6.x/migrations#foreign-key-constraints For default migrations in older versions of Laravel use unsignedInteger() method: $table->unsignedInteger(‘order_id’); Or: $table->integer(‘order_id’)->unsigned(); https://laravel.com/docs/5.5/migrations#foreign-key-constraints

Is it possible to define a timestamp column that is not null and has no default and no special behavior on update?

Timestamp columns are a special case. See here: By default, TIMESTAMP columns are NOT NULL, cannot contain NULL values, and assigning NULL assigns the current timestamp. For more detailed information read up on Data Type Default Values. Specifically that situation applies when not running in strict mode. If running in strict mode, inserting a NULL … Read more

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