问题
I've a mysql database with table tbl_setting
with InnoDB type. Its autocommit is set to 1. I executed following queries in phpmyadmin.
begin;
INSERT INTO tbl_setting (setting_name) VALUES ('test');
commit;
While browsing from phpmyadmin, it is showing the desired result; But in command mode of Windows 8, with query SELECT * FROM tbl_setting
it is not displaying the row I just inserted. I am needing to do commit in command mode to get the desired output. Shouldn't the database be updated automatically?
回答1:
After long research I found the problem. The autocommit in command mode was set 0; So, after executing SET @@AUTOCOMMIT = 1;
query, the problem was solved.
来源:https://stackoverflow.com/questions/15330834/commit-not-working-in-phpmyadmin-mysql