MySQL> ERROR 1018 (HY000): Can’t read dir of ‘.’ (errno: 13)

I moved the data directory of MySQL to a dedicated disk in my home labo (Virtual Machine running Ubuntu Linux 14.04 LTS) by using the following procedure:

  1. Stop the MySQL daemon by initiating the command: sudo /etc/init.d/mysqld restart.
  2. Change the ownership of the target folder (on the dedicated disk): sudo chown -R mysql /disk/folder. See remark below!
  3. Change the group ownership of the target folder: sudo chgrp -R mysql /disk/folder.
  4. Move the data from the old- to the new directory: sudo cp -Rp /var/lib/mysql/* /disk/folder/.
  5. Change the MySQL configuration in the my.cnf file: sudo nano /etc/mysql/my.cnf. Change the parameter datadir to /disk/folder.
  6. Start the MySQL dameon by executing: sudo /etc/init.d/mysql start.

Continue reading

Disable Notice of Undefined variable in WAMP SERVER

I’m writing a little application in PHP to assist us in some recurring system management tasks. When I opened the webapp on my home computer with MAMP, the page was displayed properly. When I tried the setup the same webapp on another computer with WAMP everthing was shown as it was at home, but several warnings were displayed.

Continue reading