travis mysql database create user error

后端 未结 1 1735
广开言路
广开言路 2021-02-09 04:35

I wanted to set up travis for my spring-boot project where I use user makler/makler for accessing database. When running travis I get an error saying:

$ mysql -u         


        
相关标签:
1条回答
  • 2021-02-09 04:51

    Its the quotes surrounding the query. Update your before_script to surround the queries using double quotes(") instead of single quotes(')

    before_script:
    - mysql -u root -e 'CREATE DATABASE stockmarket;'
    - mysql -u root -e "CREATE USER 'makler'@'localhost' IDENTIFIED BY 'makler';"
    - mysql -u root -e "GRANT ALL ON stockmarket.* TO 'makler'@'localhost';"
    

    Build worked fine after I changed it and ran the build on travis. Hope this helps.

    0 讨论(0)
提交回复
热议问题