brew link mysql did not complete - mysql

For some some reason brew does not link mysql and it complains about permission.
I chmod the folder to 777 but I am still having the same issues
laptop$ brew install mysql
Error:
mysql-5.5.27 already installed, it's just not linked
laptop$ brew link mysql
Linking /usr/local/Cellar/mysql/5.5.27... Warning: Could not link mysql.
Unlinking...
Error:
Could not symlink file: /usr/local/Cellar/mysql/5.5.27/lib/plugin
/usr/local/lib is not writable. You should change its permissions.

I figured what the problem was.
It was issues with premission and I basically did this
sudo chown -R $(whoami) /usr/local/lib/

I believe You should:
sudo chmod 775 /usr/local/lib/
and make sure You are member of the file's group.

Not really an answer, but a comment that may help those who are pulling out hair chowning and chmoding like crazy and still getting "not writeable" errors at linking. For example, from $ brew doctor -d
Error: /usr/local/lib/pkgconfig isn't writable.
This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.
I suggest you check the linked file and it's dependencies and either delete them and reinstall via homebrew, or install the package without using homebrew.

In my system this worked perfectly.
chown -R $(whoami) /usr/local/share/

I am trying to give a general answer to the question.
It happens that neither /usr/local/lib/ nor /usr/local/share/ gives error. You should look the exact directory that is not writable. It is mentioned right after "Error: Could not symlink". So execute the command for that directory.
chown -R $(whoami) [/bath/to/your/dir]

Related

I am using Ubuntu, XAMPP, MySQL, and Geany. Trouble using fopen();

So when I try to use:
fopen("sometext.txt", "w") or die("blahblahbla");
I keep on getting the following message:
failed to open stream: Permission denied". I have looked for other
answers on this site and none of them actually work.
Why is this doing this? Can somebody recommend a fix?
Do I have permission to create files in my directory? I get a bunch of advice on using chmod or changing the "file access", but how do you do this? They never explain that, just "oh use this or that".
If you have Terminal Access just fire a command in file's folder:
sudo chmod 777 sometext.txt ( For security reasons, later use correct chmod for permission)
if you dont have, you can modify File Attributes in your FTP client. ( Tick all fields (Execute-read-write) for Owner, Group, Everyone).
I hope it will solve your problem.
First, make sure you are in the apache group (check it with id username), then add your user to group apache (sudo usermod -G apache -a username) and then make sure the directory is in the group apache (check it with ls -l directory. I suppose the directory is /var/www/html or /srv/whatever, but XAMPP has its own. If not, do a sudo chgrp apache directory. Also, the directory must be writable by group members (chmod g+w directory).
Obviously in the apache configuration must be the apache user and group. If they doesn't exist, create them (sudo groupadd apache and sudo useradd apache).
P.S: chmod 777 is evil! It's better to be in the apache group and avoid making your file be edited by someone else!

Error running mysql_install_db: could not find ./bin/my_print_defaults

I seem to be having an issue getting MySQL 5.6.1.5 to install from Source. I am running RHEL 6.
I was able to perform the cmake, make, and make install without issues.
I am attempting to run the mysql_install_db binary and when I do I get the following error:
Fatal ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to copy the software
into the correct location ready for operation.
If you are using a binary release, you must either bat at the top level of the
extracted archive, or pass the --basedir option pointing to that location.
So I did a check for my_print_defaults using which my_print_defaults, unfortunately it was not found on my machine.
I did a locate my_print_defaults as well just for the heck of it and said it was located in /usr/bin/my_print_defaults, however, when I checked /usr/bin for the binary, it was not actually there.
I would try to use mysql_install_db --basedir=/usr/bin but I know this won't work as the which and locate commands confirm my_print_defaults isn't on my machine.
I looked at mysql_install_db giving error, but that error was not similar to this one.
Please ignore question, I didn't bother to try running find / -name my_print_defaults and found it in /usr/local/mysql/bin/
I searched packages for my_print_defaults with
apt-file search my_print_defaults
If my_print_defaults is missing on your system (which my_print_defaults), first find out which db is installed with:
dpkg -l |grep -E 'maria|mysql'|grep ii|grep server
If you have installed mariadb, try reinstall mariadb:
sudo apt install --reinstall mariadb-server-core-10.1
If you don't find a solution with mariadb, swap back to mysql with
sudo apt install mysql-server

Nupic Installation Ubuntu 13.04

I am having a heck of a time installing NUPIC on ubuntu-13.04-desktop-amd64.iso [within Exsi 5.1].
I've followed the instructions on https://github.com/numenta/nupic/wiki/Install-Nupic-on-ubuntu-13.04. The install fails at:
pip install -r external/common/requirements.txt
with the following error:
error: could not create '/usr/local/lib/python2.7/dist-packages/asteval': Permission denied
It works if I use sudo pip install... but just fails on
$NUPIC/build.sh
I also had to add
sudo apt-get install python-dev
sudo apt-get install python-numpy
to even get it to the "pip install..." point.
Any assistance would be appreciated.
Thanks,
Neil
I had the same problem trying to install nupic.
I was following these instructions:
https://github.com/numenta/nupic/wiki/Running-Nupic-in-a-Virtual-Machine
The problem you may be facing is that your user does not have read/write access to the /usr/local/lib/python2.7/dist-packages/asteval folder. You can use the chown command to change that folders ownership to the user you want and give that user read/write access.
With regards to the above instructions, I installed using sudo but failed to realize that the environment variables for root were different than the environment variables for the user I created to install nupic.
Hope this helps,
VS
Thank you for the report. I've created a ticket to address this installation issue.
Neilg, please try these instructions: https://github.com/numenta/nupic/wiki/Installing-NuPIC-on-Ubuntu
The problem you may be facing is that your user does not have read/write access to the /usr/local/lib/python2.7/dist-packages/asteval folder. You can use the chown command to change that folders ownership to the user you want and give that user read/write access.
YOU NEED TO ADD THE OPTION --user after pressed commands

Mysql_install_db cannot find file

I am trying to use mysql_install_db
I am getting the following error:
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
I've tried using
which my_print_defaults
It returns:
/usr/local/bin/my_print_defaults
So I try the command:
mysql_install_db --base-dir=/usr/local/bin/
I still receive the same error, though.
Annoyingly, this just means you have to be in the right directory to execute this. Make sure you're in /usr/local/Cellar/mysql/<version>/ before running the script.
You must run the command:
# mysql_install_db --basedir=/usr/local
That is without bin. This option must specify a directory path location of the directory ./bin.
Anyone reading this after installing MySQL with Homebrew may have experienced this issue:
https://stackoverflow.com/questions/4788381/getting-cant-connect-through-socket-tmp-mysql-when-installing-mysql-on-m
And then found their way here after the final instruction didn't work. I simply ran
mysql.server start
after reading http://benjsicam.me/blog/how-to-install-mysql-on-mac-os-x-using-homebrew-tutorial
Then it all started working miraculously (seems I just hadn't started it?!).
If you use Brew, try to run mysql_install_db with --basedir="$(brew --prefix mariadb)"
Change mariadb to mysql if you use mysql.
For me the fix was to point basedir to the actual mysql directory in the cellar, as shown at install.
eg:
During installation of mysql (using brew install mysql56), I was shown this path: /usr/local/Cellar/mysql56/5.6.27/bin/mysql_install_db...
I used that to define the basedir like so:
mysql_install_db --verbose --user=`whoami` --basedir="/usr/local/Cellar/mysql56/5.6.27" --datadir=/usr/local/var/mysql --tmpdir=/tmp
gotta add the path of mysql installation in system path
try: sudo path=${PATH}:/usr/local/mysql/bin
if you installed mysql in "/usr/local/mysql"

mysql_install_db gives FATAL ERROR: Could not find my-default.cnf

I've download MySQL and I'm trying to setup the MySQL grant tables, but when I type:
scripts/mysql_install_db --basedir=/usr/local
I get the error above.
I'm not sure how to fix it, as my-default.cnf is in the support_files directory and I believe I'm setting the basedir correctly.
(This is on mac btw)
(I'm assuming you're using Homebrew, since I hit the same issue trying to do the same thing on Homebrew on my macbook)
I believe you need to point it to the actual mysql directory in the cellar as its basedir, not at /usr/local (since that's just things symlinked from the cellar dir).
So, in my case, I had to use:
$ mysql_install_db --basedir=/usr/local/Cellar/mysql/5.6.10
Need copy /usr/share/my.cnf
Try this:
sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
sudo mysql_install_db
Its help for me on Ubuntu 14.04 and mysql 5.6.33
To extend to rascalking's answer, the current mysql installs to /usr/local/mysql/ via brew.
But to get over timestamp issue and the permission issue the full command will be:
sudo mysql_install_db --basedir=/usr/local/mysql --explicit_defaults_for_timestamp
Don't forget to set your password first incase you skipped the instruction:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'