Access denied when using go get - mysql

I was using go get go get the go-sql-driver from github. When I ran the command go get -u github.com/go-sql-driver/mysql as prompted by the repo, I encountered an error saying "access is denied":
go: writing stat cache: mkdir C:\Program Files\GoPath\pkg: Access is denied.
go: downloading github.com/go-sql-driver/mysql v1.5.0
go get github.com/go-sql-driver/mysql: mkdir C:\Program Files\GoPath\pkg: Access is denied.
I am using Windows 10. This happened when I changed the %GOPATH% environment variable. Any suggestions on solving this?
It seems like Go doesn't have the right to access the "Program Files" folder. I created a GoPath folder at another place and go get seemed to work. However, it created a folder named "pkg" in "GoPath", but from the compilation file I am having, it looks like the package should be installed under an "src" folder. Could somebody please explain how this happened?

mkdir C:\Program Files\GoPath\pkg: Access is denied.
It looks like access denied while trying to create directory. Either change the installation directory or grant access to the path mentioned.
If it is your development machine or laptop, open Command Prompt as administrator and try installation.

Related

Syslog-ng - File permission error in suse Linux

I am getting the below given error when I try to forward certain log files using syslog-ng in Suse Linux
Starting syslog servicesError opening file for reading; filename='/tmp/app.log', error='Permission denied (13)'
my conf file - Source definition seems to be ok
source app {
file("/tmp/app.log");
};
I went through similar posts and dont see any problems with my steps.The weird part is that the file is owned by root and when i run syslog-ng as root it gives read permission error
Am I missing anything?
This problem is caused because of AppArmor linux security module. Solution to this problem is mentioned in attached thread. syslog-ng read file permission denied
Here are steps I followed.
Open /etc/apparmor.d/sbin.syslong-ng
Add /opt/xxx/logs/* rw, line anywhere. rw below means allow read & write access. Change your directory appropriately.
Run apparmor_parser -r /etc/apparmor.d/sbin.syslong-ng to set new rules.
Restart syslog-ng using service command or any other way you have set up.

Strange response (about MySQL) for heroku login on windows (closed)

I have heroku toolbelt installed on Windows7 (x64 HomeEd). When i'm trying to login to heroku, i recieve strange message about MySQL (though MySQL already works fine with all software installed):
Microsoft Windows [Version 6.1.7601]
(c) Microsoft Corp., 2009. All rights reserved.
C:\windows\system32>heroku login
"MySQL" is not recognized as an internal or external command,
operable program or batch file.
"MySQL" is not recognized as an internal or external command,
operable program or batch file.
C:\windows\system32>
Exactly like shown - two times. As I found, heroku.bat does not invoke MySQL at any step. I think that OS runs some script (a kind of autoexec) just before or in parallel with heroku.bat, but i can't find the way used to do this. This is confirmed by the fact that when i start the other bat files the same two messages about MySQL appears.
Can you help me find how that strange script is invoked?
Detailed research shown that the reason is MySQL component, named "MySQL Fabric 1.5.3 & MySQL Utilities 1.5.3 1.5". During installation MySQL added it's location to Path environment variable. This caused to break Path variable contents with "&" symbol and any invocation of Path variable cause error
It seems that at some point a script tries to call MySQL.exe and this file can't be found. To solve this problem you should add the Directory containing MySQL.exe to %PATH%. First make sure MySQL.exe is located on your system. If you are not sure where it is, start CMD, go to your root directory (CD \) end enter dir /S MySQL.exe. This will search your drive for the file and show you the path, where it can be found. Save the path somewhere.
Now that you know where the file is is, you have to add it's location to %PATH%. To do so enter setx PATH "<NEWPATH>;%path%;" where is the path to the directory containing MySQL.EXE. Dont forget ;%path%;, this is very important. If you don't put it there it wil mess up your %PATH%.
Close the console, open a new one and type heroku login. This should fix the problem.
Now if you are not interested in fixing the error and just want to know where it comes from, you should post the code of the batch file that is executed by calling heroku login.
Just remove the C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\; from your path (It is breaking things up, it gets added during MySQL installation)and add the MySQL bin path. For me it is C:\Program Files\MySQL\MySQL Server 5.7\bin

mySQL installer - access to path is denied

I'm trying to install mySQL 5.7.7, but on the 'Apply Server Configuartion' page the 'writing configuration file' fails and the log gives the error as:
'Could't find path 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini'
So then I manually added the folder and got this error:
'Access to the path 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini' is denied.'
Following advice online I've given 'Everyone' full-access to mySQL plus all files in the path, but I still keep getting the same error.
Any ideas? Much appreciated, thanks
Maybe your my.ini file is not where it should be. To figure out exactly what his location is:
Open the Task Manager, go to the Services tab and then hit the Services button.
Search in the list for the service called 'MySQL56'. Right click on it, and hit Properties.
In the General tab, look for "Path to executable". After --defaults-file= you should see the exact path of the file my.ini.
If the file is in the folder you specified but you still can't access it, maybe you should try to reinstall.

With the Sublime Text 2 SFTP plugin, when I try to save the file I get a failure (Permission denied) message. Why?

I logged in fine, as I can browse the directories fine and open the files, but when I go to save I get a permission denied error. What am I doing wrong?
Maybe simply you don't have the permission to write to the directory.
Mac or PC? I had the same problem on OSX when using SFTP with XAMPP built in FTP server (so i could update local files instead of remote).
Try modifying the permissions on your XAMPP folder (CMD + I) and set EVERYONE to READ/WRITE. Then click the cog (gear icon) and choose apply. This will apply the permissions to all subfolders as well.
Try uploading your files again and see if you still get permission denied errors.
If doing this for a remote server, you'll have to make sure your SFTP user account is listed within an allowed group or is owner of files on your server.
Hope this helps.
Yes, make sure you have write permissions. The easiest way to check and update is the follwing:
ls -al see which permissions are on your file
sudo chmod 777 file_name give permissions to desired file
See more about establishing permissions for an entire group of files http://www.rackspace.com/knowledge_center/article/how-to-add-linux-user-with-document-root-permissions
Take two steps:
check your server permission
make sure you local sftp-config.json
{
"type": "sftp", // not ftp if port is default
}

How do I set MYSQL environment variable in Ubuntu?

So I installed XAMPP (in Ubuntu), and it was successful,
the location of MYSQL is on, /opt/lampp/bin/mysql, and so I have to include the entire path to access mysql as seen below:
$/opt/lampp/bin/mysql -u root -p
And it can login.
But using just "mysql" isn't working; it says not found.
Can you give me an idea on how to set env't variable for mysql?
New in Ubuntu. help? :(
in your home directory there's a file called .bash_profile (use ls -la to see it because files starting with . are by default hidden
There will probably already be a line similar to this one:
PATH=$PATH:$HOME/bin
Change it to
PATH=$PATH:$HOME/bin:/opt/lampp/bin/
This is the easiest way, there are other ways to eg do this so that all users on the system will automatically get this directory in their path, for more detailed answers go to our sister site askubuntu.com