There are various method to setup multiple of mysql instances on a single linux ubuntu server. In this scope of this page, i will show you the most simple one. You can follow the steps below to get it done: 1. Create separate data and log directories We need to create new directories for our datadir and log folder (if used). Also we need to assign proper permissions on those folders: mkdir /var/lib/mysql2 chown -R mysql.mysql /var/lib/mysql2/ mkdir /var/log/mysql2 chown -R mysql.mysql /var/log/mysql2 2. Create a new mysql configuration file Next we need a separate configuration file. We can start by copying the existing one andRead More →

When you run mysqldump , by default it will not export your procedures or function , if you want to include these info , you need to add –routines option in your mysqldump command. mysqldump <other mysqldump options> —routines > outputfile.sql Let’s assume we want to backup ONLY the stored procedures and triggers and not the mysql tables and data (this can be useful to import these in another db/server that has already the data but not the stored procedures and/or triggers), then we should run something like: mysqldump –routines –no-create-info –no-data –no-create-db –skip-opt <database> > outputfile.sql and this will save only the procedures/functions/triggers of the <database>.Read More →

error_reporting = E_ALL & ~E_NOTICE => PHP will stop if we have any error related to E_DEPRECATED , it may not show you any warning – very silent – different to debug , this is when we use some old function. error_reporting = EALL & ~E_NOTICE & ~ E_DEPRECATED => it will skip the error and let you continue to run.Read More →

There are 3 commands that we can use sar top mpstats You may need to install sysstat package to use these commands : apt-get install sysstat If you install sysstat , enable systat by edit: nano /etc/default/sysstat    -> change ENABLE from false to true.Read More →

My OS crash today and i had to reinstall mysql server. I am using Windows 2003 (quite old  😉 There are a few things happen when i reinstall the mysql , and it happens at the “instance” configuration step. 1. Canot find my-template.ini , => Fix: copy my-template.ini to bin/ directory 2. Can not start service It’s because the mysql path in Services is not correct : C:\Program Files\MySQL\MySQL Cluster 5.5\bin\bin\mysqld” –defaults-file=”H:\Program Files\MySQL\MySQL Cluster 5.5\bin\my.ini”  MySQL => open registry , go to HKLM \ System\Current Control Set1\ Services Locate mysql , and update the path => Try to restart , if you still can notRead More →