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



    run_sql_script(__DIR__ . '/sql/activate.sql');

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