Systemwide permission problems - mysql

I've been installing Node, NVM, NPM and some other tools lately on my MacBook. After a while, suddenly, I discovered that mysqld wasn't booting anymore due to the following:
Operating system error number 13 in a file operation. The error means mysqld does not have the access rights to the directory.
I figured I should reinstall mysql with brew, but doing that led to:
$ brew remove mysql
Uninstalling /usr/local/Cellar/mysql/5.6.17_1...
Error: Permission denied - /usr/local/include/mysql
Than tried:
$ brew cleanup
Removing: /usr/local/Cellar/openssl/1.0.1g...
Error: Permission denied - /usr/local/Cellar/openssl/1.0.1g/bin/c_rehash
Also installing fails:
$ brew install mysql
Error: Cannot write to /usr/local/Cellar
I didn't change anything to brew or it's directories, so this problem is coming from somewhere else. I remember when installing NVM I made some changes to permissions, but can't remember exactly what is was..

Turns out in the past I changed the owner of /usr/local. Changing it back to whoami did the trick..

Related

Can't start mysql (Homebrew Mac M1)

I have a error when i try to run the MYSQL server
When i try to run with brew services start mysql, return me this error
brew services start mysgl
Bootstrao failed: 5: Inout/outout error
Try re-running the command as root for richer errors
Error: Failure while executina;
`/bin/launchetl bootstrap qui/501 /Users/<user>
/Library/LaunchAgents/homebrew.mxcl.mysql.plist`exited with 5
If i ran this with sudo don't work
%
sudo brew services start mysgl
Warning: Taking root:admin ownership of some mysql paths:
/opt/homebrew/Cellar/mysql/8.0.30_1/bin
/opt/homebrew/Cellar/mysq1/8.0.30_1/bin/mysqld_safe
/opt/homebrew/opt/mysql
/opt/homebrew/opt/mysql/bin
/opt/homebrew/var/homebrew/linked/mvsal
This will require manual removal of these paths using
sudo rm' on
brew upgrade/reinstall/uninstall.
Warning: mysql must be run as non-root to start at user login!
/Library/LaunchDaemons/homebrew.mxcl.mysql.plist:servic ealready bootstrapped
Bootstrap failed: 37: Operation already in progress
Error: Failure while executing: `/bin/launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.mysql.plist`exited with 37
<user>~ % brew services list
Name status User File
mysql stopped root ~/Librarv/LaunchAgents/homebrew.mxcl.mvsal.olist
I was try to unistall and install the HomeBrew and the MYSQL again but always had the same ¡s errors.
Thanks for the help.
Not a real answer:
If it is not absolutely required for you to run it as a native process, run it in docker.
Besides that: mysql wants to run as root, as the error message says. Maybe you need to correct the mode bits. Inspect the brew post installation steps carefully, usually there is a hing or command to execute.

Permission issue while mysql installation using Homebrew on OSX

My mysql setup got corrupted which I installed using dmg file, I tried link this link
to clear all traces of mysql and re-installed using dmg again, but I was facing same issue, so I decided to do it with homebrew using installation via homebrew link
But that also didn't work and giving me below error while running the command brew install mysql
Error: Permission denied - /tmp/github_api_headers20161012-13067-iv1vz
I tried changing owner also but that also didn't work for me:
sudo chown -R $(whoami) /tmp/
Someone has faced any such issue??
I am using OSX Yosemite 10.10.3

ERROR! The server quit without updating PID file on El captian

I have problem mysql starting, i was update to El captian on mac.
In terminal,
brew install mysql
mysql.server start
but it not working
this is error message.
Starting MySQL... ERROR! The server quit without updating PID file(/usr/local/var/mysql/Heo-MacBook-Pro.local.pid).
help me please!
I had the same problem using brew command to start mysql service.
If you are using MacOS, go to System Preferences and click on MySQL icon. Probably you'll see information message about permission denied in some directories. All you need to do is to give permission to that.
That's worked for me.
Open your terminal
Execute this command: sudo chown -R mysql /usr/local/mysql/data
Try this first:
/usr/local/var/mysql/support-files/mysql.server restart
If that doesn’t fix
Remove or backup the /etc/my.cnf
also try this method:
sudo /usr/local/var/mysql/support-files/mysql.server start
Starting MySQL
. ERROR! ....................
remove the .err files like so:
rm *.err /usr/local/var/mysql/data/
Solution working for my case:
Check your error log at /usr/local/var/mysql/Heo-MacBook-Pro.local.err
If there is something like this in the log: ...[Note] Unable to delete pid file: Permission denied..., which means mysql does not have the permission to your mysql folder
Use the following command in terminal to grant the permission: sudo chown -R mysql /usr/local/var/mysql/
The Problem could also be a version mismatch. My db was installed with Homebrew as version 5, later unintentionally upgraded to version 8.
Check the most recent error log at /usr/local/var/mysql/<your-computers-name.some.domain>.err
You can conveniently read the last couple of lines (e.g. 40) of the file with tail -n 40 <your-computers-name.some.domain>.err
You may find a hint about upgrading istructions in this case.

Mysql2::Error: Can't read dir - after reinstall of mysql from homebrew on OS X

My previous install of MySQL on OS X was done manually with the native package installer.
Someone was helping me with an issue I had with upgrading some gems, and in process they installed mysql from the homebrew tools.
Since that point, I'm unable to access any of my local databases from MySQLWorkbench or from my various rails apps, but logging in with mysql on CLI using the same credentials allows me to read and write to all tables as normal.
The error I'm receiving from rails when I try to load a page is:
Mysql2::Error: Can't read dir of './r4/' (errno: 13): SHOW TABLES LIKE 'schema_migrations'
Any ideas as to what I can do to fix that?
Found the issue - permissions had changed on the /usr/local/mysql/data folder, I had to run:
cd /usr/local/mysql/data
sudo chown -R _mysql mysql*
* Note: Replace mysql* with the directory/directories causing the error. *

fresh installed mysql and mysql-server but failed to start server

I am new to Linux and tried to install mysql in my local box
I googled a lot and follow the instruction but none of them works
some people recommand this" but it did not work for me and system give me warning about this is not a official version.
Basically what I did was:
yum install mysql mysql-version
succeed without error, version is 5.5.28
systemctl start mysqld.service
here it threw out error:
Job failed. See system logs and 'systemctl status' for details.
I am using Fedora 16 (3.1.0-7.fc16.i686)
Thank you in advance
Could you try running
yum groupinstall "MySQL Database"
then run
service mysqld start
and see the outcome. Assuming you are running as root or with root permissions.
Got the EXACT same problem. It seems there is an issue regarding the permissions of the /var/lib/mysql directory.
This nailed it for me:
chown -R mysql.mysql /var/lib/mysql
Source: http://www.vivaolinux.com.br/dica/Como-solucionar-ERROR-2002-Cant-connect-to-local-MySQL-server