How to Solve MySQL Error Message ERROR 1292 (22007) : Incorrect datetime value: ‘0000-00-00 00:00:00’ for column

This is an article discussing about how to solve a specific MySQL Error Message. The error message is in the title of this article. To be more specific, the error message is ‘ERROR 1292 (22007) : Incorrect datetime value: ‘0000-00-00 00:00:00′ for column’.  It can appear when a restore process of a database fails.  It is in the following output of command execution :

[root@hostname ~]# mysql -uroot db_app < db_app.sql 
ERROR 1292 (22007) at line XXX: Incorrect datetime value: '0000-00-00 00:00:00' for column 'dateupdate' at row 1
[root@hostname ~]#

As in the above output command execution, the error message appears. It happens in the middle of restoring a database. In order to solve the problem, there is a specific setting of the sql_mode. The following is the step to solve it :

1. First, logging in to MySQL command console.

Continue reading

How to Solve MySQL Error Message ERROR 1265 (01000): Data truncated for column ‘column_name’ at row

This is an article where the main discussion or its written to solve the error problem specified in the title of this article. The article is triggered upon inserting new rows to a table in a database which all the data are extracted fro another table located in another database. For more information, below is the actual output shown as an error message upon inserting new records :

user@hostname:~$ mysql -uroot -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2537
Server version: 5.7.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> insert into newdb.table1 from select * from olddb.table1;
ERROR 1265 (01000): Data truncated for column 'column_name' at row 1
mysql> 

Continue reading

How to Change Definer in MySQL Views

In this article, as shown in the title of the article which is how to change definer inMySQL views, this article is written to show how to change definer in MySQL views. At first, definer of a file is actually specified in the MySQL Database dump file  where it can actually be changed.  It is quite simple to change it if the prerequisite on accessing MySQL Database Server can be fulfilled.

The prerequisite can be specified as follows :

Continue reading

All About MySQL

This is a page which contains list of articles related to MySQL Database Server  :

Tips for Access

  1. How to Access MySQL Database Server via Command Line.
  2. How to Remote Execute MySQL Query via Command Line.

Tips for Checking MySQL Version

How to Check MySQL Version in Linux via Command Line .

Tips for Backup MySQL Database

  1. How to Create Daily Backup MySQL Database using Cron in Linux .
  2. How to Backup all existing database in MySQL Database Server.

Tips for Retrieving Data

  1. How to Export MySQL Query Result to CSV via Command Line.
  2. How to Retrieve Result from Remote Executable MySQL Database Query to File.

Tips for Column Management

1.How to Change Column Order in MySQL Database Server via Command Line.
2. How to drop column in MySQL Database Server.

Tips for Table Management

  1. How to Create Additional Table for Many to Many Relationship in MySQL Database Server.
  2. How to Alter Table Add Field after Another Field MySQL Database Server via Command Line with Example.
  3. How to Alter Table Add Primary Key in MySQL Database Server via Command Line with Example.

Tips for Foreign Key

  1. How to Add Foreign Key in MySQL Database Server via Command Line .
  2. How to Drop Foreign Key in MySQL Database Server via Command Line .

Tips for Privileges Management

  1. How to Show Privileges in MySQL Database Server via Command Line .
  2. How to Show Privileges of a User in MySQL Database Server via Command Line .
  3. How to Revoke Privilege in MySQL Database Server

Tips for User Management

How to Drop User in MySQL Database Server .

Tips for Showing Create Script

How to Show Create Script in MySQL Database Server via Command Line .

Error

  1. How to solve MySQL Error Message : ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) .
  2. How to solve MySQL Error Message : There can be only one auto column and it must be defined as a key .
  3. How to solve MySQL Error Message Multiple primary key defined .
  4. How to get SQL Query history in MySQL .
  5. How to solve MySQL Database Generate ERROR 1064 (42000): You have an error in your SQL syntax Add Foreign Key .
  6. How to solve MySQL Error Message Cannot add or update a child row: a foreign key constraint fails .
  7. How to solve MySQL Error Failed to dump MySQL Database /tmp file permission denied
  8. How to solve MySQL Error Cannot Change root Password MySQL using MySQL console .
  9. How to Solve MySQL Error Database generate ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails .
  10. How to Solve MySQL Error Database generate ERROR 1215 (HY000): Cannot add foreign key constraint .
  11. How to Solve MySQL Error Dumping Database on MySQL Database Definer does not Exist .
  12. How to Solve MySQL Error Message : ERROR 1114 (HY000) at line 4032: The table ‘table’ is full .
  13. How to Solve MySQL Error Message : ERROR 1010 (HY000): Error dropping database (can’t rmdir ‘./db’, errno: 39) .
  14. How to Solve MySQL Error Message : ERROR 1548 (HY000) at line 1: Cannot load from mysql.proc. The table is probably corrupted

How to Drop Column in MySQL via Command Line

This is an article where the focus is about executing a specific query in MySQL Database Server. The specific query itself is a query to drop column in MySQL Database Server. In order to drop a specific column in a MySQL Database Server, the following are steps to be able to achieve it via command line :

1. Make sure MySQL Database Server has already installed.

2. Make sure the service of MySQL Database Server is active by checking the status of the service whether it is running or not. To be able to check it, just read the following article titled ‘Check MySQL Service Status’ in this link.

Continue reading