mysql installed by macports mysql.user is empty
ryandesign at macports.org
Mon Mar 28 16:38:27 PDT 2011
On Mar 28, 2011, at 17:46, Alex Yang wrote:
> On Mon, Mar 28, 2011 at 3:06 PM, Ryan Schmidt wrote:
>> On Mar 28, 2011, at 10:56, Alex Yang wrote:
>> > I use macport install mysql-5 in mac snow leopard, after changging
>> > permision of mysql directory under var/run and var/db,
>> You should not have needed to change the permissions of the directories; they should already have been correct after installing the mysql5-server port. Did you install the mysql5-server port, or only the mysql5 port?
> sudo port install php5 +apache2 +mysql5-server
> That is what I use
If you use "port variants php5" you will see that the php5 port does not have a variant called "mysql5-server" so MacPorts will ignore that and will install php5 with only the apache2 variant (i.e. PHP 5 with support for the Apache 2 web server). So it will be as if you had run:
sudo port install php5 +apache2
In fact, apache2 is the default variant of php5, so it will be as if you had run:
sudo port install php5
If you want to access a MySQL server using PHP, then you should also install the PHP MySQL extension, which is in the php5-mysql port.
sudo port install php5-mysql
If you want to run that MySQL server on this same Mac, then you also should install the mysql5-server port:
sudo port install mysql5-server
This will install the mysql5 port (which provides the MySQL programs and libraries) and the mysql5-server port (which provides some extra configuration preparing those programs and libraries to be used as a server -- including creating the necessary directories and setting their permissions correctly).
More information about the macports-users