XDG_RUNTIME_DIR not set in the environment











up vote
1
down vote

favorite
1












I open a terminal and use sudo -s -u mysql. Now when i try to open a file, whose owner is mysql using gedit xyz.err, I get the error :



No protocol specified

** (gedit:23076): WARNING **: Could not open X display
No protocol specified
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:23076): Gtk-WARNING **: cannot open display: :0


Is there some way to resolve this error ?










share|improve this question






















  • I think it might have something to do with the fact that mysql is a system account as opposed to being a user account.
    – faizal
    May 14 '14 at 17:59










  • I think it is related to the way is mounted your Drive Are you trying to execute it from an other partition? I got a very similar error and as far as I can tell is about the other drive (in my case) is not mounted with executable permission. Still investigating, just wanted to let you know.
    – elemer82
    Jul 10 '14 at 19:08










  • Possible duplicate of error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:
    – Scott
    May 20 '16 at 18:55






  • 1




    See also difference between sudo and gksudo and Open a new terminal window on another user session, and maybe also Gtk-WARNING **: cannot open display and Gtk-WARNING with display when using sudo in nx.
    – Scott
    May 20 '16 at 18:56















up vote
1
down vote

favorite
1












I open a terminal and use sudo -s -u mysql. Now when i try to open a file, whose owner is mysql using gedit xyz.err, I get the error :



No protocol specified

** (gedit:23076): WARNING **: Could not open X display
No protocol specified
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:23076): Gtk-WARNING **: cannot open display: :0


Is there some way to resolve this error ?










share|improve this question






















  • I think it might have something to do with the fact that mysql is a system account as opposed to being a user account.
    – faizal
    May 14 '14 at 17:59










  • I think it is related to the way is mounted your Drive Are you trying to execute it from an other partition? I got a very similar error and as far as I can tell is about the other drive (in my case) is not mounted with executable permission. Still investigating, just wanted to let you know.
    – elemer82
    Jul 10 '14 at 19:08










  • Possible duplicate of error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:
    – Scott
    May 20 '16 at 18:55






  • 1




    See also difference between sudo and gksudo and Open a new terminal window on another user session, and maybe also Gtk-WARNING **: cannot open display and Gtk-WARNING with display when using sudo in nx.
    – Scott
    May 20 '16 at 18:56













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I open a terminal and use sudo -s -u mysql. Now when i try to open a file, whose owner is mysql using gedit xyz.err, I get the error :



No protocol specified

** (gedit:23076): WARNING **: Could not open X display
No protocol specified
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:23076): Gtk-WARNING **: cannot open display: :0


Is there some way to resolve this error ?










share|improve this question













I open a terminal and use sudo -s -u mysql. Now when i try to open a file, whose owner is mysql using gedit xyz.err, I get the error :



No protocol specified

** (gedit:23076): WARNING **: Could not open X display
No protocol specified
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:23076): Gtk-WARNING **: cannot open display: :0


Is there some way to resolve this error ?







ubuntu






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 14 '14 at 15:58









faizal

106113




106113












  • I think it might have something to do with the fact that mysql is a system account as opposed to being a user account.
    – faizal
    May 14 '14 at 17:59










  • I think it is related to the way is mounted your Drive Are you trying to execute it from an other partition? I got a very similar error and as far as I can tell is about the other drive (in my case) is not mounted with executable permission. Still investigating, just wanted to let you know.
    – elemer82
    Jul 10 '14 at 19:08










  • Possible duplicate of error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:
    – Scott
    May 20 '16 at 18:55






  • 1




    See also difference between sudo and gksudo and Open a new terminal window on another user session, and maybe also Gtk-WARNING **: cannot open display and Gtk-WARNING with display when using sudo in nx.
    – Scott
    May 20 '16 at 18:56


















  • I think it might have something to do with the fact that mysql is a system account as opposed to being a user account.
    – faizal
    May 14 '14 at 17:59










  • I think it is related to the way is mounted your Drive Are you trying to execute it from an other partition? I got a very similar error and as far as I can tell is about the other drive (in my case) is not mounted with executable permission. Still investigating, just wanted to let you know.
    – elemer82
    Jul 10 '14 at 19:08










  • Possible duplicate of error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:
    – Scott
    May 20 '16 at 18:55






  • 1




    See also difference between sudo and gksudo and Open a new terminal window on another user session, and maybe also Gtk-WARNING **: cannot open display and Gtk-WARNING with display when using sudo in nx.
    – Scott
    May 20 '16 at 18:56
















I think it might have something to do with the fact that mysql is a system account as opposed to being a user account.
– faizal
May 14 '14 at 17:59




I think it might have something to do with the fact that mysql is a system account as opposed to being a user account.
– faizal
May 14 '14 at 17:59












I think it is related to the way is mounted your Drive Are you trying to execute it from an other partition? I got a very similar error and as far as I can tell is about the other drive (in my case) is not mounted with executable permission. Still investigating, just wanted to let you know.
– elemer82
Jul 10 '14 at 19:08




I think it is related to the way is mounted your Drive Are you trying to execute it from an other partition? I got a very similar error and as far as I can tell is about the other drive (in my case) is not mounted with executable permission. Still investigating, just wanted to let you know.
– elemer82
Jul 10 '14 at 19:08












Possible duplicate of error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:
– Scott
May 20 '16 at 18:55




Possible duplicate of error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:
– Scott
May 20 '16 at 18:55




1




1




See also difference between sudo and gksudo and Open a new terminal window on another user session, and maybe also Gtk-WARNING **: cannot open display and Gtk-WARNING with display when using sudo in nx.
– Scott
May 20 '16 at 18:56




See also difference between sudo and gksudo and Open a new terminal window on another user session, and maybe also Gtk-WARNING **: cannot open display and Gtk-WARNING with display when using sudo in nx.
– Scott
May 20 '16 at 18:56










2 Answers
2






active

oldest

votes

















up vote
0
down vote













You can get an interactive session by using su - mysql, and then run gedit. Works for me.



man sudo doesn't give any details, but it could be that the default shell launched with -s is very limited.






share|improve this answer























  • my intention is a bit different. I want to keep a terminal open that uses the mysql account previliges. That is why i use the "sudo -s -u mysql". So that any further commands don't require me to use sudo. Using gksudo to open gedit every time does not really serve my purpose.
    – faizal
    May 14 '14 at 16:16










  • Using "su - mysql" and then gedit, as suggested in your edited answer, also gives me the same error.
    – faizal
    May 14 '14 at 16:55


















up vote
0
down vote













You're looking in the wrong place, running mysql as (system) user mysql won't solve anything.



mysql is a client program, the authentication to the server, run by mysqld, is made on the connection (tcpdump port 3306 to make it clear).



Therefore, you can launch mysql with any "system" user, like:



$ mysql -u root -p localhost


Give the admin ("root") password when prompted, and then you should see this:



Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 240
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>


...and there you go!






share|improve this answer























  • Sorry for the misleading OP, but it has nothing to do with the mysql program. It is to do with opening a file in gedit with a particular account, which happens to be mysql.
    – faizal
    Aug 9 '14 at 11:55













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fsuperuser.com%2fquestions%2f753449%2fxdg-runtime-dir-not-set-in-the-environment%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








up vote
0
down vote













You can get an interactive session by using su - mysql, and then run gedit. Works for me.



man sudo doesn't give any details, but it could be that the default shell launched with -s is very limited.






share|improve this answer























  • my intention is a bit different. I want to keep a terminal open that uses the mysql account previliges. That is why i use the "sudo -s -u mysql". So that any further commands don't require me to use sudo. Using gksudo to open gedit every time does not really serve my purpose.
    – faizal
    May 14 '14 at 16:16










  • Using "su - mysql" and then gedit, as suggested in your edited answer, also gives me the same error.
    – faizal
    May 14 '14 at 16:55















up vote
0
down vote













You can get an interactive session by using su - mysql, and then run gedit. Works for me.



man sudo doesn't give any details, but it could be that the default shell launched with -s is very limited.






share|improve this answer























  • my intention is a bit different. I want to keep a terminal open that uses the mysql account previliges. That is why i use the "sudo -s -u mysql". So that any further commands don't require me to use sudo. Using gksudo to open gedit every time does not really serve my purpose.
    – faizal
    May 14 '14 at 16:16










  • Using "su - mysql" and then gedit, as suggested in your edited answer, also gives me the same error.
    – faizal
    May 14 '14 at 16:55













up vote
0
down vote










up vote
0
down vote









You can get an interactive session by using su - mysql, and then run gedit. Works for me.



man sudo doesn't give any details, but it could be that the default shell launched with -s is very limited.






share|improve this answer














You can get an interactive session by using su - mysql, and then run gedit. Works for me.



man sudo doesn't give any details, but it could be that the default shell launched with -s is very limited.







share|improve this answer














share|improve this answer



share|improve this answer








edited May 14 '14 at 16:21

























answered May 14 '14 at 16:04









l0b0

5,41222341




5,41222341












  • my intention is a bit different. I want to keep a terminal open that uses the mysql account previliges. That is why i use the "sudo -s -u mysql". So that any further commands don't require me to use sudo. Using gksudo to open gedit every time does not really serve my purpose.
    – faizal
    May 14 '14 at 16:16










  • Using "su - mysql" and then gedit, as suggested in your edited answer, also gives me the same error.
    – faizal
    May 14 '14 at 16:55


















  • my intention is a bit different. I want to keep a terminal open that uses the mysql account previliges. That is why i use the "sudo -s -u mysql". So that any further commands don't require me to use sudo. Using gksudo to open gedit every time does not really serve my purpose.
    – faizal
    May 14 '14 at 16:16










  • Using "su - mysql" and then gedit, as suggested in your edited answer, also gives me the same error.
    – faizal
    May 14 '14 at 16:55
















my intention is a bit different. I want to keep a terminal open that uses the mysql account previliges. That is why i use the "sudo -s -u mysql". So that any further commands don't require me to use sudo. Using gksudo to open gedit every time does not really serve my purpose.
– faizal
May 14 '14 at 16:16




my intention is a bit different. I want to keep a terminal open that uses the mysql account previliges. That is why i use the "sudo -s -u mysql". So that any further commands don't require me to use sudo. Using gksudo to open gedit every time does not really serve my purpose.
– faizal
May 14 '14 at 16:16












Using "su - mysql" and then gedit, as suggested in your edited answer, also gives me the same error.
– faizal
May 14 '14 at 16:55




Using "su - mysql" and then gedit, as suggested in your edited answer, also gives me the same error.
– faizal
May 14 '14 at 16:55












up vote
0
down vote













You're looking in the wrong place, running mysql as (system) user mysql won't solve anything.



mysql is a client program, the authentication to the server, run by mysqld, is made on the connection (tcpdump port 3306 to make it clear).



Therefore, you can launch mysql with any "system" user, like:



$ mysql -u root -p localhost


Give the admin ("root") password when prompted, and then you should see this:



Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 240
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>


...and there you go!






share|improve this answer























  • Sorry for the misleading OP, but it has nothing to do with the mysql program. It is to do with opening a file in gedit with a particular account, which happens to be mysql.
    – faizal
    Aug 9 '14 at 11:55

















up vote
0
down vote













You're looking in the wrong place, running mysql as (system) user mysql won't solve anything.



mysql is a client program, the authentication to the server, run by mysqld, is made on the connection (tcpdump port 3306 to make it clear).



Therefore, you can launch mysql with any "system" user, like:



$ mysql -u root -p localhost


Give the admin ("root") password when prompted, and then you should see this:



Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 240
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>


...and there you go!






share|improve this answer























  • Sorry for the misleading OP, but it has nothing to do with the mysql program. It is to do with opening a file in gedit with a particular account, which happens to be mysql.
    – faizal
    Aug 9 '14 at 11:55















up vote
0
down vote










up vote
0
down vote









You're looking in the wrong place, running mysql as (system) user mysql won't solve anything.



mysql is a client program, the authentication to the server, run by mysqld, is made on the connection (tcpdump port 3306 to make it clear).



Therefore, you can launch mysql with any "system" user, like:



$ mysql -u root -p localhost


Give the admin ("root") password when prompted, and then you should see this:



Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 240
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>


...and there you go!






share|improve this answer














You're looking in the wrong place, running mysql as (system) user mysql won't solve anything.



mysql is a client program, the authentication to the server, run by mysqld, is made on the connection (tcpdump port 3306 to make it clear).



Therefore, you can launch mysql with any "system" user, like:



$ mysql -u root -p localhost


Give the admin ("root") password when prompted, and then you should see this:



Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 240
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>


...and there you go!







share|improve this answer














share|improve this answer



share|improve this answer








edited Jul 29 '14 at 13:43









digitxp

11.6k74675




11.6k74675










answered Jul 29 '14 at 13:36









Marabiloso

1




1












  • Sorry for the misleading OP, but it has nothing to do with the mysql program. It is to do with opening a file in gedit with a particular account, which happens to be mysql.
    – faizal
    Aug 9 '14 at 11:55




















  • Sorry for the misleading OP, but it has nothing to do with the mysql program. It is to do with opening a file in gedit with a particular account, which happens to be mysql.
    – faizal
    Aug 9 '14 at 11:55


















Sorry for the misleading OP, but it has nothing to do with the mysql program. It is to do with opening a file in gedit with a particular account, which happens to be mysql.
– faizal
Aug 9 '14 at 11:55






Sorry for the misleading OP, but it has nothing to do with the mysql program. It is to do with opening a file in gedit with a particular account, which happens to be mysql.
– faizal
Aug 9 '14 at 11:55




















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • 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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2fsuperuser.com%2fquestions%2f753449%2fxdg-runtime-dir-not-set-in-the-environment%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

Plaza Victoria

Puebla de Zaragoza

Musa