Genel, Linux

awk ile tek tirnak kacirma (single quote in awk)

Olurya bir gun awk icinde mysql girdi islemi yapmak zorunda kalirsaniz diye buraya yazayim dedim. Asagida ki ornek referans olabilir. awk icinde tek tikrnak kacirma "'\''" $2 "'\''"
cat logins_ | awk '{print "INSERT INTO `mail_log`.`login` (`logins_id`, `logins_date`, `logins_type`, `logins_email`, `logins_last`) VALUES (NULL, " "'\''" $2 " " $1 "'\''""," "'\''" $4 "'\''""," "'\''" $7 "'\''""," "NULL"");" }'
Genel, Linux

mysql ‘de innodb ‘yi aktif etme

Merhabalar, Ilk once innodb aktif edilmis mi ? yoksa edilmemis mi ? ona bakalim. show engines; ciktisinda InnoDB Support 'ta NO ibaresi yer aliyorsa innodb 'yi aktif etmemiz gerekmektedir. mysql -uroot -p
mysql> show engines; +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | InnoDB | NO | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ 8 rows in set (0.02 sec) mysql>
  my.cnf dosyasini bir metin duzenleyici ile acalim. (vi,nano,pico etc.) vim /etc/mysql/my.cnf skip-innodb satirini bulup asagidaki gibi basina # isaretini ekleyelim. #skip-innodb /etc/init.d/mysql restart eger halen innodb aktif olarak gozukmuyorsa yapmaniz gereken son birsey daha vardir. cd /var/lib/mysql/ mv ibdata1 /tmp/ mv ib_logfile0 ib_logfile1 /tmp/ simdi tekrardan /etc/init.d/mysql restart edelim ve mysql -uroot -p ile giris yaptiktan sonra show engines; komutunu calistiralim.  Ornek bir show engines ciktisi.
root@gw:~# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11494 Server version: 5.1.66-0+squeeze1 (Debian) Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show engines; +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ 8 rows in set (0.02 sec) mysql>
Sevgiler