MYSQL使用的时候遇到的一些问题

1.  之前使用的时候遇到编码有问题。在MYSQL的命令行里输入了status结果显示如下:

    Server characterset: latin1

    Db     characterset: utf8

    Client characterset: latin1

    Conn.  characterset: latin1

   解决: 命令行里收入set names utf8结果显示如下:

    Server characterset: latin1

    Db     characterset: utf8

    Client characterset: utf8

    Conn.  characterset: utf8

    参考: http://hi.baidu.com/leejun_2005/blog/item/99c471a69761148bd0435836.html


2. 依然是苦逼的编码.今天往一个表插入数据,结果老是乱码,刚开始以为是表的编码问题, 后来发现改了表的编码以后依然有这样的问题,之后才发现原来表的字段是有编码的。我好土= =!

    参考: http://paulfzm.iteye.com/blog/761546


3. 事务/锁= =!一直没仔细去看过(希望以后开发能用上,嘿嘿)

     参考: http://hi.baidu.com/cubeking/item/1c1791adca371fa028ce9d18

                http://andyhu1007.iteye.com/blog/236271

                http://lectery.iteye.com/blog/357306

                http://blog.csdn.net/wangzhuoyan/article/details/4201485

                http://www.ningoo.net/html/2008/mysql_innodb_transaction_isolation_level.html

                http://space.itpub.net/8562502/viewspace-232238

                http://www.oschina.net/question/12_2760 (看的不是很懂)

    PS: MYSQL的InnoDB引擎下,可重复读(Repeatable Read)的事务隔离级别不会造成“幻读”。(在5.5.28版本下做的测试),具体见官方文档 http://dev.mysql.com/doc/refman/5.5/en/innodb-record-level-locks.html

By default, InnoDB operates in REPEATABLE READ transaction isolation level and with the innodb_locks_unsafe_for_binlog system variable disabled. In this case, InnoDB uses next-key locks for searches and index scans, which prevents phantom rows (see Section 14.3.9.5, “Avoiding the Phantom Problem Using Next-Key Locking”).

你可能感兴趣的:(MYSQL使用的时候遇到的一些问题)