Mysql Problem, Operating system error number 13 in a file operation

Posted by cikul | Posted in Linux, SQL | Posted on 31-07-2017-05-2008

0

Mysql Fail to start, check in /var/log/mysqld.log :


170731 16:56:50 InnoDB: Initializing buffer pool, size = 8.0M
170731 16:56:50 InnoDB: Completed initialization of buffer pool
170731 16:56:50 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
170731 16:56:50 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

 

Cause :

Permission problem in /var/lib/mysql

Solutions :

  1. Ensure user and group permission on /var/lib/mysql is mysql
  2. Check SELINUX Configuration : getenforce
  3. If SELINUX enabled, disabled with command : setenforce 0
  4. For permanent disable, edit /etc/selinux/config and set SELINUX=disabled
  5. Try to restart mysql service

Create Bootable CentOS USB from Mac OS

Posted by cikul | Posted in Linux, Mac OS | Posted on 22-06-2017-05-2008

0

Create img file from downloaded iso :

Fors-MacBook-Air:Downloads cikul$ hdiutil convert -format UDRW -o CentOS-69.img CentOS-6.9-x86_64-minimal.iso        
Reading CentOS_6.9_Final                 (Apple_ISO : 0)…
...............................................................................................................................................................................................
Reading  (Apple_Free : 1)…
Elapsed Time:  2.059s
Speed: 198.1Mbytes/sec
Savings: 0.0%
created: /Users/cikul/Downloads/CentOS-69.img.dmg

List All Devices, and umount USB before flashing new image

Fors-MacBook-Air:~ cikul$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage For Sale                120.5 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Dhika Cikul            +120.1 GB   disk1
                                 Logical Volume on disk0s2
                                 EC5A9E2D-8AD9-4317-8AA6-D42A92874136
                                 Unencrypted

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *15.4 GB    disk2
   1:             Windows_FAT_32 NO NAME                 15.4 GB    disk2s1

Fors-MacBook-Air:~ cikul$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful

Use dd utility to copy the iso/img to USB Flash :

Fors-MacBook-Air:Downloads cikul$ time sudo dd if=CentOS-69.img.dmg of=/dev/disk2 bs=1m
Password:
408+0 records in
408+0 records out
427819008 bytes transferred in 120.542862 secs (3549103 bytes/sec)

real	2m3.909s
user	0m0.016s
sys	0m7.868s

Done…

Add Static Route Linux – Windows – Mac OS

Posted by cikul | Posted in Linux, Mac OS, Windows | Posted on 22-06-2017-05-2008

0

In Linux the command is :


route add -net 172.17.18.0/24 gw 172.17.2.1

In Windows the command is :


route add 172.17.18.0 mask 255.255.255.0 172.17.2.1

In Mac OS the command is :


route -n add -net 172.17.18.0/24 172.17.2.1

Fix CentOS USB Install Problem

Posted by cikul | Posted in Linux | Posted on 01-06-2016-05-2008

0

When installing CentOS using USB stick, i experienced problem with repository install after partition


Unable to read package metadata. This may be due to missing repodata directory. Please ensure that your install tree has been correctly generated. Failare: repodata/743fec56b2af0ce8d6ec82c47a4efafc2a4d18cddfa9683f29611cb18d1a33de-primary.sqlite.bz2 from anaconda-CentOS-201311271240.i386: [Ermo 256] No more mirrors to try.

The problem is because installer cannot found the file which described in repomd file located in /repodata folder

To fix the problem, go to /repodata folder on your usb stick, and change the file under repodata matched to the parameter configured in repomd file, for example :

in repomd location :

location href=”repodata/b124f0ec5323cfee56b420906a3103f0daef656dde3f7ac8220120aa7504e57a-primary.xml.gz”

so you must find the file under /repodata folder which matched with the configuration, and change the extension in accordance with the parameter configured in repomd file.

[script] Auto Backup Mysql

Posted by cikul | Posted in Linux, Programming | Posted on 27-05-2016-05-2008

0

Now we will creating simple script to backup mysql databases, this script will automatically list all databases and back it up in a folder defined.


#!/bin/bash
# Simple script to backup MySQL databases

# Parent backup directory
backup_parent_dir="/backup/mysql"

# MySQL settings
mysql_user="root"
mysql_password="******"

# Read MySQL password from stdin if empty
if [ -z "${mysql_password}" ]; then
echo -n "Enter MySQL ${mysql_user} password: "
read -s mysql_password
echo
fi

# Check MySQL password
echo exit | mysql --user=${mysql_user} --password=${mysql_password} -B 2>/dev/null
if [ "$?" -gt 0 ]; then
echo "MySQL ${mysql_user} password incorrect"
exit 1
else
echo "MySQL ${mysql_user} password correct."
fi

# Create backup directory and set permissions
backup_date=`date +%Y_%m_%d_%H_%M`
backup_dir="${backup_parent_dir}/${backup_date}"
echo "Backup directory: ${backup_dir}"
mkdir -p "${backup_dir}"
chmod 700 "${backup_dir}"

# Get MySQL databases
mysql_databases=`echo 'show databases' | mysql --user=${mysql_user} --password=${mysql_password} -B | sed /^Database$/d`

# Backup and compress each database
for database in $mysql_databases
do
if [ "${database}" == "information_schema" ] || [ "${database}" == "performance_schema" ]; then
additional_mysqldump_params="--skip-lock-tables"
else
additional_mysqldump_params=""
fi
echo "Creating backup of \"${database}\" database"
mysqldump ${additional_mysqldump_params} --user=${mysql_user} --password=${mysql_password} ${database} | gzip > "${backup_dir}/${database}.gz"
chmod 600 "${backup_dir}/${database}.gz"
done

 

Change & Reset Mysql Password

Posted by cikul | Posted in Linux, SQL, Tips | Posted on 18-10-2015-05-2008

0

This tutorial explains how to change or reset your MySQL root password under Unix-Like Operating Systems (Linux, FreeBSD, OpenBSD, etc) over SSH. MySQL root account should be managed carefully.

As a system administrator, we must ensure that the password is safe and prevent from unauthorized access.

There are some method to change mysql password :

Type 1 : use mysqladmin

However, if you want to change mysql root/user password, mysql had tool to simplify the process using mysqladmin command, the syntax is :


$ mysqladmin -u root -p'oldpassword' password newpass
$ mysqladmin -u dbuser -p'oldpassword' password 'itsnewpassword';

Read the rest of this entry »

[CentOS] Merubah Gambar Background GRUB saat booting

Posted by cikul | Posted in Linux | Posted on 01-03-2015-05-2008

0

Gambar pada tampilan awal GRUB biasanya mengikuti distro linux yang kita gunakan, seperti contoh untuk CentOS maka Tampilan awal GRUB akan menampilkan gambar background dari CentOS seperti gambar berikut

grubCentOS

Tampilan Splash Screen GRUB

sekarang bagaimana cara kita mengganti background image default tersebut?

Read the rest of this entry »

Completely Uninstall Kloxo-MR

Posted by cikul | Posted in cpanel, Free Stuff, Internet, Linux | Posted on 13-11-2014-05-2008

2

Based on my experience, it’s easy to find tutorial how to install Kloxo-MR, but hard to find tutorial how to uninstall Kloxo-MR, lack of documentation for Kloxo-MR make the installation of Kloxomr difficult for some system administrators.

If you had problem during kloxo-mr installation, the easy way to troubleshoot is recreate your VPS container, but if you won’t do that, you can reinstalling kloxo-mr from scratch, but make sure the system has clean from previous install to avoid problem.

Read the rest of this entry »

Get Windows Version from ISO files

Posted by cikul | Posted in Windows | Posted on 10-09-2014-05-2008

1

You want to install windows 7 pro 64 bit, and you had downloaded the ISO source from internet, but before install you’re not sure your ISO master is correct with your requirement (32 bit or maybe download Home edition).

Basically, any windows installation has WIM files within, Install.wim contains several sysprepped images of your Windows installation, and we can extract the information from install.wim to get the version of your installation.

Read the rest of this entry »

[excel] Unprotect Excel Sheets without password

Posted by cikul | Posted in Windows | Posted on 02-09-2014-05-2008

0

Unprotect excel sheets can be done with VBA Macro.

To open VBA macro press ALT + F11, after Microsoft Visual Basic Open, press F5 to create new macro,

Insert this code :

Sub RemovePassword()
    Dim i As Integer, j As Integer, k As Integer
    Dim l As Integer, m As Integer, n As Integer
    Dim i1 As Integer, i2 As Integer, i3 As Integer
    Dim i4 As Integer, i5 As Integer, i6 As Integer
    On Error Resume Next
    For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
    For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
    For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
    For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
    ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
        Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
        Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
    If ActiveSheet.ProtectContents = False Then
        MsgBox "You can use the password to unprotect : " & Chr(i) & Chr(j) & _
            Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
            Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
         Exit Sub
    End If
    Next: Next: Next: Next: Next: Next
    Next: Next: Next: Next: Next: Next
End Sub

To execute the macro press F5

The script will return output :

“You can use the password to unprotect : XFSTGAJHG”

The password provided can use to open sheets in same workbook which still protected.