#!/bin/bash DB_NAME="" TABLES=`mysql -uroot -e "use $DB_NAME;show tables" | tail -n +2` SQL="" while read table do SQL+="alter table $table charset=utf8mb4;" done <<END $TABLES END mysql -uroot -e "use $DB_NAME; $SQL"
既存のカラムは置換されない模様
#!/bin/bash DB_NAME="" TABLES=`mysql -uroot -e "use $DB_NAME;show tables" | tail -n +2` SQL="" while read table do SQL+="alter table $table charset=utf8mb4;" done <<END $TABLES END mysql -uroot -e "use $DB_NAME; $SQL"
既存のカラムは置換されない模様
public Orm find(int id){}
Class<?> type = Class.forName("java.lang.Integer"); Class<?> clazz = Class.forName("orm.EmployeeOrm"); Method method = clazz.getDeclaredMethod("find", type); method.invoke(clazz.newInstance(), 1);
Class<?> type = int.class; Class<?> clazz = Class.forName("orm.EmployeeOrm"); Method method = clazz.getDeclaredMethod("find", type); method.invoke(clazz.newInstance(), 1);
Map<String, String> RELATED_TABLE = new HashMap<String, String>() { { put("hoge", "ほげ"); put("fuga", "ふが"); put("piyo", "ぴよ"); } }; for(Map.Entry<String, String> t: RELATED_TABLE.entrySet()){ System.out.println(t.getValue()+":"+ t.getKey()); }
$ find / -name "*my.cnf*" $ # 見つけた my.cnf を全てrm $ ps -ef | grep mysql $ # ゾンビがいたら殺す $ mysql.server start