3 votes

Comment lancer le démarrage automatique de mysql ? Obtention de "Path had bad ownership/permissions" (Le chemin a une mauvaise propriété/permissions)

Comment démarrer automatiquement mysqld

J'ai essayé ce qui suit https://stackoverflow.com/q/26476391/631619 mais cela n'a pas aidé

Il semble que j'aie un problème de propriété/permission, peut-être lié au fait que j'ai installé mysql sur cette machine pour un compte utilisateur différent.

J'ai désinstallé et réinstallé mais j'obtiens toujours

$ brew install mysql
==> Downloading https://homebrew.bintray.com/bottles/mysql-5.6.27.yosemite.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/mysql-5.6.27.yosemite.bottle.tar.gz
==> Pouring mysql-5.6.27.yosemite.bottle.tar.gz
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
    mysql -uroot

To have launchd start mysql at login:
  ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
  mysql.server start

WARNING: launchctl will fail when run under tmux.
==> Summary
  /usr/local/Cellar/mysql/5.6.27: 9883 files, 339M
16:55:49 pengo EQ-390 /Users/pengo
$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
/Users/pengo/Library/LaunchAgents/homebrew.mxcl.mysql.plist -> /usr/local/opt/mysql/homebrew.mxcl.mysql.plist
16:56:36 pengo EQ-390 /Users/pengo
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
/usr/local/Cellar/mysql/5.6.27/homebrew.mxcl.mysql.plist: Operation not permitted
$ sudo launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
/usr/local/Cellar/mysql/5.6.27/homebrew.mxcl.mysql.plist: Path had bad ownership/permissions
$ l ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
lrwxr-xr-x  1 pengo  staff  46 Nov  7 16:56 /Users/pengo/Library/LaunchAgents/homebrew.mxcl.mysql.plist@ -> /usr/local/opt/mysql/homebrew.mxcl.mysql.plist
$

I peut démarrer mysqld manuellement cependant, c'est à dire..

$ mysqld
2015-11-07 17:02:22 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-07 17:02:22 0 [Note] mysqld (mysqld 5.6.27) starting as process 21472 ...
2015-11-07 17:02:22 21472 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2015-11-07 17:02:22 21472 [Note] Plugin 'FEDERATED' is disabled.
2015-11-07 17:02:22 21472 [Note] InnoDB: Using atomics to ref count buffer pool pages
...

puis dans une autre fenêtre

$ mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.27 Homebrew

Copyright (c) 2000, 2015, 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>

Également pour information

$ l /usr/local/bin/mysql
lrwxr-xr-x  1 pengo  admin  32 Nov  7 16:55 /usr/local/bin/mysql@ -> ../Cellar/mysql/5.6.27/bin/mysql

Ai-je besoin de chown whoami pour des fichiers supplémentaires ?

J'ai essayé d'ajouter

export PATH=${PATH}:/usr/local/Cellar/mysql/5.6.27/bin/mysqld

à mon .bashrc sur la base du fait d'avoir

$ l /usr/local/Cellar/mysql/5.6.27/bin/mysqld -r-xr-xr-x  1 pengo  admin  
11948736 Nov  7 16:54 /usr/local/Cellar/mysql/5.6.27/bin/mysqld*

mais j'ai toujours les mêmes erreurs.

1voto

Michael Durrant Points 16006

Il semble que l'ajout du chemin d'accès à mon .bashrc était probablement la solution.

export PATH=${PATH}:/usr/local/Cellar/mysql/5.6.27/bin/mysqld

J'ai également besoin de quitter une session mysql en cours qui était ouverte.

LesApples.com

LesApples est une communauté de Apple où vous pouvez résoudre vos problèmes et vos doutes. Vous pouvez consulter les questions des autres utilisateurs d'appareils Apple, poser vos propres questions ou résoudre celles des autres.

Powered by:

X