Tuesday, October 31, 2017

Error de importaciĆ³n SQL ERROR 1292 (22007) datetime value 0000-00-00


Si te encuentras con este tipo de mensaje:

root@sistemas:/var/www/html/proyectos# mysql -uroot -p proyectos < database.sql
Enter password:

ERROR 1292 (22007) at line 752: Incorrect datetime value: '0000-00-00 00:00:00' for column 'created' at row 1


Es debido a que tu versiĆ³n de Mysql no soportara el valor 0000-00-00 para la fecha, entonces debes reemplazarlo como sigue:

vim  database.sql


:%s/0000-00-00/1970-01-01/g

Posteriormente la importacion sera exitosa

Tuesday, July 18, 2017

MYSQL: "is marked as crashed"

Message found:
"mysqldump: Got error: 145: Table is marked as crashed and should be repaired when using LOCK TABLES"
And if Table Repair tool doesn't works, try this:


1.-Stop MYSQL service:

[root@webapp html]# service mysql stop

2.-Change to DB folder:


[root@webapp html]# cd /var/lib/mysql/mesadeayuda

3.-Send command:

[root@webapp html]#  myisamchk -r -v -f glpi_logs --sort_buffer_size=2G
- glpi_logs is a table's name (change this)
- Sort buffer is very important.

Partial result:


4.-Start MYSQL service:

[root@webapp html]# service mysql start

Monday, July 4, 2016

APF over Ubuntu 14.04



Ubuntu 14.04 with new kernel (Linux cloud 4.2.0-27-generic) is not supported by APF, so we have to hardcode (/etc/apf/internals/functions.apf) again as follow:


if [ "$KREL" == "2.4" ]; then
        MEXT="o"
elif [ "$KREL" == "2.6" ]; then
        MEXT="ko"
elif [[ "$KREL" =~ "3." ]]; then
        MEXT="ko"
elif [[ "$KREL" =~ "4." ]]; then
        MEXT="ko"
elif [ ! "$KREL" == "2.4" ] && [ ! "$KREL" == "2.6" ] && [[ ! "$KREL" =~ "3." ]]; then
        if [ ! "$SET_VERBOSE" == "1" ]; then
                echo "kernel version not compatible or netfilter support missing, aborting."
        fi
        eout "{glob} kernel version not compatible or netfilter support missing, aborting."
        exit 1
else
        if [ ! "$SET_VERBOSE" == "1" ]; then
                echo "kernel version not compatible or netfilter support missing, aborting."
        fi
        eout "{glob} kernel version not compatible or netfilter support missing, aborting."
        exit 1
fi


Saturday, October 3, 2015

OVA files over PROXMOX

Maybe you need to load an *.OVA file into proxmox, so you can do the following:



1.- Download (anywhere) the OVA file: (I use wget)
root@cdn32gw:/OVAfile# wget http://dl.l2lk3.net/download/VM/Cor8-DEMO-1.0.ova

2.- Untar downloaded file to get the VMDK (hdd) file:

root@cdn32gw:/OVAfile# tar -xvf Cor8-DEMO-1.0.ova

3.- Format disk container to QCOM2

root@cdn32gw:/OVAfile# qemu-img convert -f vmdk Cor8-DEMO-1.0-disk1.vmdk -O qcow2 newdisk.qcow2
Finally my files are:
root@cdn32gw:/OVAfile# ls -l 
-rw-r--r-- 1 root root 6460932096 Oct  3 newdisk.qcow2
-rw-r--r-- 1 root root 3433728000 May 21 Cor8-DEMO-1.0.ova
-rw------- 1 root root 3433705472 May 20 Cor8-DEMO-1.0-disk1.vmdk
-rw------- 1 root root      12311 May 20 Cor8-DEMO-1.0.ovf


4.- Review *.ovf file containing some VM's parameters in order to create a brand new VM with those same features inside PROXMOX (by using Web GUI)

---> Debian_64
Debian_64 
2 virtual CPU
2048 MB of memory
ideController0 
Ethernet adapter on 'Bridged'
E1000



5.- Create a VM inside Proxmox (as usual)

Note: Harddisk have to be QEMU


This is mine:




6.- Replace brand new harddisk with the *.vmdk (downloaded and formated to Qcow2)

root@cdn32gw:/OVAfile# mv newdisk.qcow2 /var/lib/vz/images/500/vm-500-disk-1.qcow2


7.- Start VM and have fun!