Minimum user rights for connecting MS Sql database remotedly












2















I have followed this tutorial for getting connected to a Microsoft SQL Server. I connect with ping functionality of Glassfish Server and thus I have to give some user rights to be able to even ping the Database.



My problem is that probably my user has not rights to take external connections to the database or even more sad, not any permissions. What kind of user permissions there should be applied before I can connect to my database with my user?



(I suppose there are needed some GRANTS before accessing the database, because making that on Mysql needed quite many of them. Now the actual problem is I could not apply the same queries here 'cause the SQL scripts are incombatible)










share|improve this question





























    2















    I have followed this tutorial for getting connected to a Microsoft SQL Server. I connect with ping functionality of Glassfish Server and thus I have to give some user rights to be able to even ping the Database.



    My problem is that probably my user has not rights to take external connections to the database or even more sad, not any permissions. What kind of user permissions there should be applied before I can connect to my database with my user?



    (I suppose there are needed some GRANTS before accessing the database, because making that on Mysql needed quite many of them. Now the actual problem is I could not apply the same queries here 'cause the SQL scripts are incombatible)










    share|improve this question



























      2












      2








      2


      1






      I have followed this tutorial for getting connected to a Microsoft SQL Server. I connect with ping functionality of Glassfish Server and thus I have to give some user rights to be able to even ping the Database.



      My problem is that probably my user has not rights to take external connections to the database or even more sad, not any permissions. What kind of user permissions there should be applied before I can connect to my database with my user?



      (I suppose there are needed some GRANTS before accessing the database, because making that on Mysql needed quite many of them. Now the actual problem is I could not apply the same queries here 'cause the SQL scripts are incombatible)










      share|improve this question
















      I have followed this tutorial for getting connected to a Microsoft SQL Server. I connect with ping functionality of Glassfish Server and thus I have to give some user rights to be able to even ping the Database.



      My problem is that probably my user has not rights to take external connections to the database or even more sad, not any permissions. What kind of user permissions there should be applied before I can connect to my database with my user?



      (I suppose there are needed some GRANTS before accessing the database, because making that on Mysql needed quite many of them. Now the actual problem is I could not apply the same queries here 'cause the SQL scripts are incombatible)







      sql-server permissions






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 5 '14 at 13:46









      Colin 't Hart

      6,58682534




      6,58682534










      asked Aug 5 '11 at 13:33









      micomico

      3462617




      3462617






















          2 Answers
          2






          active

          oldest

          votes


















          6














          Check for "CONNECT" rights



          SELECT SUSER_NAME(grantee_principal_id), * 
          FROM sys.server_permissions WHERE type = 'COSQ'
          GO
          USE MYDB
          GO
          SELECT USER_NAME(grantee_principal_id), *
          FROM sys.database_permissions WHERE type = 'CO'


          To fix as needed



          USE master
          GO
          GRANT CONNECT SQL TO myLogin
          GO
          USE MYDB
          GO
          GRANT CONNECT TO MyUser
          GO





          share|improve this answer
























          • I added CONNECT on a graphical tool (I feel more comfortable with it) and I was able to connect the Database. Thanks.

            – mico
            Aug 8 '11 at 8:25











          • To be able to connect from another machine I had to give Firewall pass to sqlservr.exe file through the firewall as well as port 1433.

            – mico
            Aug 8 '11 at 11:18



















          0














          em_scheduler:1366289344]: em_init:version=1.7.0 -- 1.7.4.2,system_path=/storage/sdcard0/TNTGameBox/Download/






          share|improve this answer








          New contributor




          user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "182"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f4380%2fminimum-user-rights-for-connecting-ms-sql-database-remotedly%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            6














            Check for "CONNECT" rights



            SELECT SUSER_NAME(grantee_principal_id), * 
            FROM sys.server_permissions WHERE type = 'COSQ'
            GO
            USE MYDB
            GO
            SELECT USER_NAME(grantee_principal_id), *
            FROM sys.database_permissions WHERE type = 'CO'


            To fix as needed



            USE master
            GO
            GRANT CONNECT SQL TO myLogin
            GO
            USE MYDB
            GO
            GRANT CONNECT TO MyUser
            GO





            share|improve this answer
























            • I added CONNECT on a graphical tool (I feel more comfortable with it) and I was able to connect the Database. Thanks.

              – mico
              Aug 8 '11 at 8:25











            • To be able to connect from another machine I had to give Firewall pass to sqlservr.exe file through the firewall as well as port 1433.

              – mico
              Aug 8 '11 at 11:18
















            6














            Check for "CONNECT" rights



            SELECT SUSER_NAME(grantee_principal_id), * 
            FROM sys.server_permissions WHERE type = 'COSQ'
            GO
            USE MYDB
            GO
            SELECT USER_NAME(grantee_principal_id), *
            FROM sys.database_permissions WHERE type = 'CO'


            To fix as needed



            USE master
            GO
            GRANT CONNECT SQL TO myLogin
            GO
            USE MYDB
            GO
            GRANT CONNECT TO MyUser
            GO





            share|improve this answer
























            • I added CONNECT on a graphical tool (I feel more comfortable with it) and I was able to connect the Database. Thanks.

              – mico
              Aug 8 '11 at 8:25











            • To be able to connect from another machine I had to give Firewall pass to sqlservr.exe file through the firewall as well as port 1433.

              – mico
              Aug 8 '11 at 11:18














            6












            6








            6







            Check for "CONNECT" rights



            SELECT SUSER_NAME(grantee_principal_id), * 
            FROM sys.server_permissions WHERE type = 'COSQ'
            GO
            USE MYDB
            GO
            SELECT USER_NAME(grantee_principal_id), *
            FROM sys.database_permissions WHERE type = 'CO'


            To fix as needed



            USE master
            GO
            GRANT CONNECT SQL TO myLogin
            GO
            USE MYDB
            GO
            GRANT CONNECT TO MyUser
            GO





            share|improve this answer













            Check for "CONNECT" rights



            SELECT SUSER_NAME(grantee_principal_id), * 
            FROM sys.server_permissions WHERE type = 'COSQ'
            GO
            USE MYDB
            GO
            SELECT USER_NAME(grantee_principal_id), *
            FROM sys.database_permissions WHERE type = 'CO'


            To fix as needed



            USE master
            GO
            GRANT CONNECT SQL TO myLogin
            GO
            USE MYDB
            GO
            GRANT CONNECT TO MyUser
            GO






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 5 '11 at 13:41









            gbngbn

            63.9k7138215




            63.9k7138215













            • I added CONNECT on a graphical tool (I feel more comfortable with it) and I was able to connect the Database. Thanks.

              – mico
              Aug 8 '11 at 8:25











            • To be able to connect from another machine I had to give Firewall pass to sqlservr.exe file through the firewall as well as port 1433.

              – mico
              Aug 8 '11 at 11:18



















            • I added CONNECT on a graphical tool (I feel more comfortable with it) and I was able to connect the Database. Thanks.

              – mico
              Aug 8 '11 at 8:25











            • To be able to connect from another machine I had to give Firewall pass to sqlservr.exe file through the firewall as well as port 1433.

              – mico
              Aug 8 '11 at 11:18

















            I added CONNECT on a graphical tool (I feel more comfortable with it) and I was able to connect the Database. Thanks.

            – mico
            Aug 8 '11 at 8:25





            I added CONNECT on a graphical tool (I feel more comfortable with it) and I was able to connect the Database. Thanks.

            – mico
            Aug 8 '11 at 8:25













            To be able to connect from another machine I had to give Firewall pass to sqlservr.exe file through the firewall as well as port 1433.

            – mico
            Aug 8 '11 at 11:18





            To be able to connect from another machine I had to give Firewall pass to sqlservr.exe file through the firewall as well as port 1433.

            – mico
            Aug 8 '11 at 11:18













            0














            em_scheduler:1366289344]: em_init:version=1.7.0 -- 1.7.4.2,system_path=/storage/sdcard0/TNTGameBox/Download/






            share|improve this answer








            New contributor




            user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              0














              em_scheduler:1366289344]: em_init:version=1.7.0 -- 1.7.4.2,system_path=/storage/sdcard0/TNTGameBox/Download/






              share|improve this answer








              New contributor




              user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0












                0








                0







                em_scheduler:1366289344]: em_init:version=1.7.0 -- 1.7.4.2,system_path=/storage/sdcard0/TNTGameBox/Download/






                share|improve this answer








                New contributor




                user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                em_scheduler:1366289344]: em_init:version=1.7.0 -- 1.7.4.2,system_path=/storage/sdcard0/TNTGameBox/Download/







                share|improve this answer








                New contributor




                user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 13 mins ago









                user11151057user11151057

                1




                1




                New contributor




                user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                user11151057 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f4380%2fminimum-user-rights-for-connecting-ms-sql-database-remotedly%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    SQL Server 17 - Attemping to backup to remote NAS but Access is denied

                    Always On Availability groups resolving state after failover - Remote harden of transaction...

                    Restoring from pg_dump with foreign key constraints