Run SQL script on plugin activation

Hello to you guys. I am training to build my plugins. or the tables in the bd I create it alone before discovering that there was a method to automate it when the plugin is created in the file activate.php at the root of the project.

here is the code of my file activate.php

 

<?php

if(!elgg_get_plugin_setting('10.1.19-MariaDB','camerproject')){
    
    run_sql_script(__DIR__ . '/sql/activate.sql');
    elgg_set_plugin_setting('10.1.19-MariaDB',1,'camerproject');
}

when I add this file to my plugin and disables the plugin and reactive I have this error:

 

Unexpected error while performing an AJAX call. Maybe the connection to the server is lost.

and the tables in question in the activate.sql file are not created

 

please help me