Wednesday, August 31, 2016

MySQL - InnoDB Imports (Faster)

mysql> use database_Name
mysql> set autocommit=0; set unique_checks=0; set foreign_key_checks=0;
mysql> source /path/to/database_dump.sql
mysql> commit; set unique_checks=1; set foreign_key_checks=1;

Friday, August 26, 2016

MySQL - Case sensitive for database name in Windows

Hi there! I'm have problem on my windows machine with LAMP stack environment to maintenance existing web system that has been deploy on Linux server. I create a copy of database and import on my local MySQL. The original database consist of lowercase and uppercase letter database name but when after imported it convert to lowercase database name that causing stupid mess error and waste lot of time!

I about MySQL collation of insensitive case and sensitive case but it seem valid on tables only, not the database name itself. I figure a work around to force MySQL on windows to store it on disk with case sensitive names.

Open you MySQL location folder and open my.ini file, insert lower_case_table_names=2 and restart the MySQL service. Done!

Friday, August 12, 2016

MySQL / MariaDB - Show warning details

mysql> flush privileges;                                                 
Query OK, 0 rows affected, 5 warnings (0.08 sec)                         
                                                                         
mysql> \w;                                                               
Show warnings disabled.                                                  
ERROR:                                                                   
No query specified                                                       
                                                                         
mysql> show warnings;                                                    
+---------+------+-------------------------------------+                 
| Level   | Code | Message                             |                 
+---------+------+-------------------------------------+                 
| Warning | 1292 | Truncated incorrect time value: 'N' |                 
| Warning | 1292 | Truncated incorrect time value: 'N' |                 
| Warning | 1292 | Truncated incorrect time value: 'N' |                 
| Warning | 1292 | Truncated incorrect time value: 'N' |                 
| Warning | 1292 | Truncated incorrect time value: 'N' |                 
+---------+------+-------------------------------------+                 
5 rows in set (0.00 sec)

Tuesday, August 9, 2016

CodeIgniter - htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1