can update but can't insert on mysql
-
- Posts: 11
- Joined: Wed Apr 12, 2017 5:02 am
can update but can't insert on mysql
I can do UPDATES on the admin_default database in mysql. But I can't do INSERTs. Again, I have a database of users with many fields such as name, age, height, etc. Everything worked well on my local development server, but in production I can only do updates/changes to the database but not create new records with INSERT statements.
********EDIT****************
FIXED MY OWN PROBLEM:
This is caused by the STRICT_TRANS_TABLES SQL mode.
Open phpmyadmin and goto More Tab and select Variables submenu. Scroll down to find sql mode. Edit sql mode and remove STRICT_TRANS_TABLES Save it.
My local phpmyadmin settings were different than the settings for phpmyadmin up at my new server. ... Note that to made the configuration changes above I needed to login as root at phpmyadmin ...
It seems that now this STRICT_TRANS_TABLES setting exists by default and you have to remove it. The mysql/phpmyadmin that previously was installed by default with vesta was different. So when doing INSERT statements you would have to be a bit more careful. I don't want it so i got rid of it.
********EDIT****************
FIXED MY OWN PROBLEM:
This is caused by the STRICT_TRANS_TABLES SQL mode.
Open phpmyadmin and goto More Tab and select Variables submenu. Scroll down to find sql mode. Edit sql mode and remove STRICT_TRANS_TABLES Save it.
My local phpmyadmin settings were different than the settings for phpmyadmin up at my new server. ... Note that to made the configuration changes above I needed to login as root at phpmyadmin ...
It seems that now this STRICT_TRANS_TABLES setting exists by default and you have to remove it. The mysql/phpmyadmin that previously was installed by default with vesta was different. So when doing INSERT statements you would have to be a bit more careful. I don't want it so i got rid of it.
Last edited by robinsouthchina on Mon Jan 08, 2018 6:51 am, edited 2 times in total.
Re: Unknown system variable 'a' -> I get this error when I try to INSERT
this sounds more like a problem in your code, not in vestacp or mysql. for example have a look here: https://stackoverflow.com/questions/136 ... m-variable
-
- Posts: 11
- Joined: Wed Apr 12, 2017 5:02 am
Re: Unknown system variable 'a' -> I get this error when I try to INSERT
FIXED MY OWN PROBLEM:
This is caused by the STRICT_TRANS_TABLES SQL mode.
Open phpmyadmin and goto More Tab and select Variables submenu. Scroll down to find sql mode. Edit sql mode and remove STRICT_TRANS_TABLES Save it.
My local phpmyadmin settings were different than the settings for phpmyadmin up at my new server. ... Note that to made the configuration changes above I needed to login as root at phpmyadmin ...
It seems that now this STRICT_TRANS_TABLES setting exists by default and you have to remove it. The mysql/phpmyadmin that previously was installed by default with vesta was different. So when doing INSERT statements you would have to be a bit more careful. I don't want it so i got rid of it.
This is caused by the STRICT_TRANS_TABLES SQL mode.
Open phpmyadmin and goto More Tab and select Variables submenu. Scroll down to find sql mode. Edit sql mode and remove STRICT_TRANS_TABLES Save it.
My local phpmyadmin settings were different than the settings for phpmyadmin up at my new server. ... Note that to made the configuration changes above I needed to login as root at phpmyadmin ...
It seems that now this STRICT_TRANS_TABLES setting exists by default and you have to remove it. The mysql/phpmyadmin that previously was installed by default with vesta was different. So when doing INSERT statements you would have to be a bit more careful. I don't want it so i got rid of it.