-->

Wednesday, March 4, 2020

Using Netcat to check connectivity to mysql on port 3306

Netcat is a tool in linux which can be very powerful is used correctly.

If you want to check the default port is pingable for mysql i.e. 3306 you can validate it via netcat


[ankit.mittal@bastion.test2]# nc -vz master-db.unixcloudfusion.in 3306
Connection to master-db.unixcloudfusion.in 3306 port [tcp/mysql] succeeded!

Tuesday, March 3, 2020

[Solved] Message: Field 'id' doesn't have a default value

Error:-
Message: Field 'id' doesn't have a default value

Cause:-
The field ID error occurred when i was inserting the ID column as the primary key

ADD COLUMN id INT(10) NOT NULL FIRST, ADD PRIMARY KEY (id)


The error signifies for the default value to be assigned since it would be unique everytime.


Solution:-
Adding the AUTO_INCREMENT in the query resolved the issue

ADD COLUMN id INT(10) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (id)

[Solved] ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

Error:-

ERROR 1227 (42000) at line 18: Access denied; you need (at least 
one of) the SUPER privilege(s) for this operation

Scenario:- I have taken a backup of the Mysql table using mysqldump and tried to restore the same in the Amazon AWS RDS

Cause:- The error occurs when database has the binary log enabled, and mysqldump file contains an object(trigger, view, function or event)

Now if any of the create statements dont include "NO SQL", "READS SQL DATA" or "DETERMINISTIC" keywords, than mysql cant write that object and import fails

Solution:-
Change the parameter group value

log_bin_trust_function_creators = 1
global_log_bin_trust_function_creators = 1 (More relaxed permission for 
                                            allowing import of all objects)