XDG_RUNTIME_DIR not set in the environment
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: :0Is there some way to resolve this error ?
42 Answers
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.
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 localhostGive 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!
1More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"