Mysql_install_db cannot find file

前端 未结 6 1437
醉话见心
醉话见心 2021-02-05 20:01

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 compi

相关标签:
6条回答
  • 2021-02-05 20:38

    If you use Brew, try to run mysql_install_db with --basedir="$(brew --prefix mariadb)"

    Change mariadb to mysql if you use mysql.

    0 讨论(0)
  • 2021-02-05 20:40

    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.

    0 讨论(0)
  • 2021-02-05 20:47

    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.

    0 讨论(0)
  • 2021-02-05 20:49

    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?!).

    0 讨论(0)
  • 2021-02-05 20:50

    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
    
    0 讨论(0)
  • 2021-02-05 21:01

    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"

    0 讨论(0)
提交回复
热议问题