Can't connect to local MySQL /tmp/mysql.sock

mysql_install_db –verbose –user=whoami –basedir=”$(brew –prefix mysql)” –datadir=/usr/local/var/mysql –tmpdir=/tmp –explicit_defaults_for_timestamp
WARNING: Could not write to config file /usr/local/homebrew/opt/mysql/my.cnf: Permission denied

Installing MySQL system tables…2014-12-17 11:40:54 77210 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-12-17 11:40:54 77210 [Note] InnoDB: The InnoDB memory heap is disabled
2014-12-17 11:40:54 77210 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-12-17 11:40:54 77210 [Note] InnoDB: Memory barrier is not used
2014-12-17 11:40:54 77210 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-12-17 11:40:54 77210 [Note] InnoDB: Using CPU crc32 instructions
2014-12-17 11:40:54 77210 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-12-17 11:40:54 77210 [Note] InnoDB: Completed initialization of buffer pool
2014-12-17 11:40:54 77210 [Note] InnoDB: Highest supported file format is Barracuda.
2014-12-17 11:40:54 77210 [Note] InnoDB: 128 rollback segment(s) are active.
2014-12-17 11:40:54 77210 [Note] InnoDB: Waiting for purge to start
2014-12-17 11:40:54 77210 [Note] InnoDB: 5.6.20 started; log sequence number 1625987
2014-12-17 11:40:54 77210 [Note] RSA private key file not found: /usr/local/var/mysql//private_key.pem. Some authentication plugins will not work.
2014-12-17 11:40:54 77210 [Note] RSA public key file not found: /usr/local/var/mysql//public_key.pem. Some authentication plugins will not work.
2014-12-17 11:40:54 77210 [Note] Binlog end
2014-12-17 11:40:54 77210 [Note] InnoDB: FTS optimize thread exiting.
2014-12-17 11:40:54 77210 [Note] InnoDB: Starting shutdown…
2014-12-17 11:40:55 77210 [Note] InnoDB: Shutdown completed; log sequence number 1625997
OK

Filling help tables…2014-12-17 11:40:55 77211 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-12-17 11:40:55 77211 [Note] InnoDB: The InnoDB memory heap is disabled
2014-12-17 11:40:55 77211 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-12-17 11:40:55 77211 [Note] InnoDB: Memory barrier is not used
2014-12-17 11:40:55 77211 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-12-17 11:40:55 77211 [Note] InnoDB: Using CPU crc32 instructions
2014-12-17 11:40:55 77211 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-12-17 11:40:55 77211 [Note] InnoDB: Completed initialization of buffer pool
2014-12-17 11:40:55 77211 [Note] InnoDB: Highest supported file format is Barracuda.
2014-12-17 11:40:55 77211 [Note] InnoDB: 128 rollback segment(s) are active.
2014-12-17 11:40:55 77211 [Note] InnoDB: Waiting for purge to start
2014-12-17 11:40:55 77211 [Note] InnoDB: 5.6.20 started; log sequence number 1625997
2014-12-17 11:40:55 77211 [Note] RSA private key file not found: /usr/local/var/mysql//private_key.pem. Some authentication plugins will not work.
2014-12-17 11:40:55 77211 [Note] RSA public key file not found: /usr/local/var/mysql//public_key.pem. Some authentication plugins will not work.
2014-12-17 11:40:55 77211 [Note] Binlog end
2014-12-17 11:40:55 77211 [Note] InnoDB: FTS optimize thread exiting.
2014-12-17 11:40:55 77211 [Note] InnoDB: Starting shutdown…
2014-12-17 11:40:57 77211 [Note] InnoDB: Shutdown completed; log sequence number 1626007
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/homebrew/opt/mysql/bin/mysqladmin -u root password ‘new-password’
/usr/local/homebrew/opt/mysql/bin/mysqladmin -u root -h jasondeMacBook-Pro.local password ‘new-password’

Alternatively you can run:

/usr/local/homebrew/opt/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; /usr/local/homebrew/opt/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Could not copy config file template /usr/local/homebrew/opt/mysql/support-files/my-default.cnf to
/usr/local/homebrew/opt/mysql/my.cnf, may not have access rights to do so.
You may want to copy the file manually, or create your own,
it will then be used by default by the server when you start it.

    原文作者:jhfnetboy
    原文地址: https://segmentfault.com/a/1190000002429197
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞