Configure MySQL 5.6 with Macports

MacOS 10.10, updated macro ports. I want to get mysql 5.6 on port 3306.

1) Installation

port install mysql56-server mysql56 

sets mysql56@5.6.22 _0, after that

 which mysql 

or

 which mysql56 

returns nothing.

So the first question is: where is the mysql client located?

2) Configuration

Installation script suggests doing

 sudo -u _mysql /opt/local/lib/mysql56/bin/mysql_install_db 

then

 /opt/local/lib/mysql56/bin/mysqladmin -u root password 'new-password' 

which requests the server to start, and I start it with

 cd /opt/local ; /opt/local/lib/mysql56/bin/mysqld_safe & 

then mysqladmin complains about the socket, and I comment on --skip-networking in / opt / local / etc / mysql 56 / macports-default.cnf, after which the command goes fine. then

 /opt/local/lib/mysql56/bin/mysqladmin -u root -h bp.local password 'new-password' 

which returns

 error: 'Host '10.0.1.9' is not allowed to connect to this MySQL server' 

I really don't know what to do here without mysql client. And I'm kinda stuck. Any suggestions?

+5
source share
1 answer

MacPorts installs MySQL and its derivatives in such a way that they do not conflict with each other and can be installed at the same time. This includes adding mysql binary to non-standard paths. You can find your binary using port contents mysql56 | grep -E '/s?bin/' port contents mysql56 | grep -E '/s?bin/' . MacPorts also comes with a picker that creates symbolic links for your convenience in /opt/local/bin . To make MySQL 5.6 the default run sudo port select --set mysql mysql56 .

To start the server, you can use the MacPorts daemon management functions (which are the interface to start): sudo port load mysql56-server will start the server and make sure it starts after reboot, sudo port unload mysql56-server cancels this and stops the server.

--skip-networking by default makes it possible to run multiple versions of MySQL side by side. See port notes mysql56 .

You can connect to MySQL MacPorts using a unix socket, although I don’t remember its path from the top of the head. I am sure that http://trac.macports.org/wiki/howto/MAMP has them. To connect to a local server, you should use localhost or 127.0.0.1 instead of bp.local , which apparently resolves a private IP address and thus goes through your OS’s IP stack, and not through the loopback interface.

+13
source

Source: https://habr.com/ru/post/1208467/


All Articles