Execute MySQL Stored Procedure using Command Line

后端 未结 4 1051
名媛妹妹
名媛妹妹 2021-02-07 10:56

Please help me out to execute a MySQL Stored procedure in command line, where the procedure contains conditional statements..

4条回答
  •  离开以前
    2021-02-07 11:17

    $ mysql --user=user_name --password=your_password db_name
    
    mysql> call stored_procedure_name();
    

    or

    $ mysql --user=user_name --password=your_password db_name < script.sql
    

    where script.sql contains your sql statement:

    call stored_procedure_name();
    

提交回复
热议问题