Sharif-Judge icon indicating copy to clipboard operation
Sharif-Judge copied to clipboard

Can't create table

Open ghost opened this issue 7 years ago • 3 comments

When installing, it popped up an error that it could not create the shj_assignments table\

Sorry for my English

ghost avatar Oct 17 '17 17:10 ghost

Maybe try connect root user @database server in config (application/config/database.php). If there are some problems, go ahead. Sorry 4 my english.

wojcik13 avatar Oct 18 '17 09:10 wojcik13

I have a solution may be can help you

Step 1 Because Blob/text columns can't have a default value in mysql. You can change the setting of mysql vim /etc/my.cnf

Step 2 Change sql-mode=" NO_ENGINE_SUBSTITUTION ,STRICT_TRANS_TABLES " To '#' sql-mode=" NO_ENGINE_SUBSTITUTION ,STRICT_TRANS_TABLES "

Step 3 service mysqld restart

then you could avoid the error of could not create the shj_assignments table but after you enter the web, you would get

The path to folder "assignments" is not set correctly. Move this folder somewhere not publicly accessible, and set its full path in Settings.

The path to folder "tester" is not set correctly. Move this folder somewhere not publicly accessible, and set its full path in Settings.

Step 4

Click the Settings on the left, and change the path of tester and assigments.

Done.

Hope this can help you.

wwhhoo avatar Oct 23 '17 13:10 wwhhoo

Disable Strict Sql Mode in Mysql 5.7 or later

  1. To disable strict SQL mode, SSH in to your server as root and create this file:

$ vim /etc/mysql/conf.d/disable_strict_mode.cnf

  1. Open the file and enter these two lines:

[mysqld] sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

  1. Restart MySQL with this command:

$ sudo service mysql restart

BUU-IT-Informaitcs avatar May 16 '19 06:05 BUU-IT-Informaitcs