When I'm trying to run an action via Github with my self hosted runner it is not possible to load the environment variables from my .zshrc file (e.g. the PATH)
When I'm executing "printenv" I will get e.g for PATH:
PATH=/usr/bin:/bin:/usr/sbin:/sbin
but it should be:
PATH=/Users/jenkins/.rbenv/shims:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/jenkins/.rbenv/shims:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin
It is only possible when I call source ~/.zshrc before the printenv.
Is it possible to open the shell directly with the zshrc env variables without sourcing it manually?
How to set environment variable for MariaDB database version 10.1.21 in Linux mint operating system and after setting environment variable how I check the variable is set or not.
I tried below command but didn't work.
export PATH=${PATH}:/usr/local/mysql/bin/
Thanks for your help !
The syntax is fine but export command will create environment variables for the current shell only. Each child process of that shell will recognize the added variable.
In order to set an environment variable permanently for a particular user you should add the line:
PATH=${PATH}:/usr/local/mysql/bin/
into the file ~/.bashrc or ~/.bash_profile
Further if you want to add for all users (in special cases), you can add that line to in system-wide configuration files present in following directories and files: /etc/environment, /etc/profile, /etc/profile.d/, /etc/bash.bashrc.
These variables are loaded every time system is powered on and logged in either locally or remotely by any user.
I'm using solaris 10 vm box, every time I login or open new terminal my PATH variable is getting reset to default, I'm using export PATH=XXX command to set my path. When I tried to change the content in /etc/skel/local.profile file changes are not getting accepted even after I set them to 777 with chmod, same when I tried to change the login file in /etc/default, and there is no file or directory named environment in /etc/ directory currently my shell shows bash. Can someone help to permanently change the PATH variable without setting it for every session?
The /etc/skel folder is only used when you create a new user, its content is copied to the new user's home folder.
If you want to change the PATH variable everytime you login to your account, then add the following to the .profile file in your home folder (create it if it doesn't already exist):
export PATH=$PATH:/some/new/path
I'm using scss-lint with gulp.js in my project and I want to add some configurations to my local scss-lint fork.
In the documentation of scss-lint it's says that I can add a configuration by creating a file named .scss-lint.yml in the styles directory, so I do:
scss_files: 'src/styles/**/*.scss'
NestingDepth:
enabled: true
max_depth: 4
SelectorDepth:
enabled: true
max_depth: 4
But when I run gulp the configurations just not apply. How can I make my configuration work?
Be sure to place your .scss-lint.yml config file either in the root directory of the working project for local use, or indeed in your Home Directory for global use.
To find the path of your Home Directory you can reference this list.
Using scss-lint with Sublime Text?
Be sure to restart the Sublime Text to activate your .scss-lint.yml config file.
I had set the MySQL path, but still getting the same error. Please let me know whether I followed the correct one or not.
MySQL location is: C:\Program Files\MySQL\MySQL Server 5.0\bin
In Windows, system variables I had set the path as:
variable name: MYSQL_HOME
variable value: C:\Program Files\MySQL\MySQL Server 5.0\bin
For PATH setting:
variable name: PATH
variable value: .;%JAVA_HOME%\bin;%MYSQL_HOME%\bin...
If it is not the correct one, please let me know the correct path and its settings.
Simply type in command prompt :
set path=%PATH%;D:\xampp\mysql\bin;
Here my path started from D so I used D: , you can use C: or E:
MYSQL_HOME variable value=> C:\Program Files\MySQL\MySQL Server 5.0\bin
%MYSQL_HOME%\bin
See the problem? This resolves to a path of C:\Program Files\MySQL\MySQL Server 5.0\bin\bin
MYSQL_HOME:
C:\Program Files\MySQL\MySQL Server 5.0
Path:
%MYSQL_HOME%\bin;
Here is what I DO on my PC, I install all software that I usually used in G: partition not C:
if my operating system is fall (win 10), Do not need to reinstall them again and lose time, Then How windows work it update PATH automatic if you install any new program or piece of software,
SO
I must update PATH like these HERE! all the software I usually used
1- I created a folder called Program Files
2- I install all my programs data in this folder
3-and then going to PATH and add it Don't forget ;
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;G:\HashiCorp\Vagrant\bin;G:\xampp\php;G:\xampp\mysql\bin;G:\Program Files (x86)\heroku\bin;G:\Program Files (x86)\Git\bin;G:\Program Files (x86)\composer;G:\Program Files (x86)\nodejs;G:\Program Files (x86)\Sublime Text 3;G:\Program Files (x86)\Microsoft VS Code\bin;G:\Program Files (x86)\cygwin64\bin
MySQL location is: C:\Program Files\MySQL\MySQL Server 8.0\bin
In Windows, system variables I had set the path as:
variable name: MYSQL_HOME
variable value: C:\Program Files\MySQL\MySQL Server 8.025\bin
For User variable for user:
Click Path ---> NEW ---> C:\Program Files\MySQL\MySQL Server 8.0.25\bin
Click OK
Now check with cmd (mysql -V)
You may get a command like this
mysql Ver 8.0.25 for Win64 on x86_64 (MySQL Community Server - GPL)
You're DONE.
I am using xampp. For me best option is to change environment variables. Environment variable changing window is shared by #Abu Bakr in this thread
I change the path value as
C:\xampp\mysql\bin;
and it is working nice
You only have to set path in the system variables and you are done with the job. Here I will show you step by step:
Step1: Go the start taskbar and write environment and click on the edit system environment option:
Step2: After clicking a dialog box namely System Properties Will occur like this:
Step3: Click on environment variables and then inside system variables in which there is written path, double click on path a new dialog box namely edit environment variables will be pop up as shown:
Then add the address of the MySql bin in windows C the path by clicking new path option, in my laptop MySql was here so added this path C:\Program Files\MySQL\MySQL Server 8.0\bin, thats it click ok and run on command prompt mysql --version command and it will show the actual version of mysql installed at your pc
In my case, it turned out to be a simple case of spacing.
Turns out, i had a space inserted after the last ; and before ""C:\Program Files\MySQL\MySQL Server 5.7"
For this very simple reason, no matter what i did, MySql was still not being recognized.
Once i eliminated the spaces before and after path, it worked perfectly.
In retrospect, seems like a very obvious answer, but nobody's mentioned it anywhere.
Also, i'm new to this whole windows thing, so please excuse me if it sounds very simple.
You can fix in 3 steps
you have to change course by
first > Copy file path
*my path is E:\Program\xampp\mysql\bin*
next in CMD I write the followin
that
set path=%PATH%;set path=%PATH%;E:\Program\xampp\mysql\bin
Don't forget to change PATH
If you use wamp server add C:\wamp64\bin\mysql\mysql5.7.31\bin to environment variables PATH
To make it easier to invoke MySQL programs in CMD, you can add the path name of the MySQL bin directory to your Windows system PATH environment variable:
follow the below link.
https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/mysql-installation-windows-path.html
In my case changing the directory to
cd C:\Program Files\MySQL\MySQL Server 8.0\bin
I have noticed no changes but when I wrote mysql
It ran perfectly
If the error isn't solved after setting the system variables and path, check the path specified in User Variables.
If the path is not set in user variables, add it.
This worked for me.
This worked for me(Windows):
Firstly in cmd type: where{space}MySQL{enter}--->It gives something like this:
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
Add path=C:\Program Files\MySQL\MySQL Server 8.0\bin to System variable. How to set path to system variable ?
Close and restart your Command prompt. After that write from anywhere in cmd:
mysql --version
It will give results:
mysql Ver 8.0.28 for Win64 on x86_64 (MySQL Community Server - GPL)
In my case, I resolved it by adding this path C:\xampp\mysql\bin to system variables path and then restarted pash/cmd.
Note: Click me if you don't know how to set the path and system variables.