MySql5 install on SnowLeopard, problems starting
Ryan Schmidt
ryandesign at macports.org
Sun Oct 10 19:09:45 PDT 2010
On Oct 10, 2010, at 20:22, Samuel V Green III wrote:
> Hoping there is someone out there who has successfully got MySql 5.1.51 running on 10.6.1 ?
>
> MySQL 5 Install MacPorts:
>
> sudo port install mysql5 +server
As Bradley already pointed out, the mysql5 port has no variant called "server"; you want the separate mysql5-server port.
> From here I couldn't get the databases initialized with this command:
> sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
Why not? what happened?
> Then I tried this:
>
> sudo -u mysql mysql_install_db5
>
> Still no luck
Why not? what happened?
Note that on Leopard and later, the user is technically _mysql (not mysql).
> and finally this seemed to work:
>
> sudo mysql_install_db5
>
> Producing :
>
> Installing MySQL system tables...
> OK
> Filling help tables...
> 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:
>
> /opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
> /opt/local/lib/mysql5/bin/mysqladmin -u root -h myserver.local password 'new-password'
>
> Alternatively you can run:
> /opt/local/lib/mysql5/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 /opt/local ; /opt/local/lib/mysql5/bin/mysqld_safe &
>
> You can test the MySQL daemon with mysql-test-run.pl
> cd /opt/local/mysql-test ; perl mysql-test-run.pl"
Well, ok, but now the database files created are owned by root, which isn't right. They need to be owned by _mysql.
> ATTEMPTING TO START WITH THIS:
>
> sudo /opt/local/share/mysql5/mysql/mysql.server start
> Password:
> Starting MySQL
>
> ...... ERROR! Manager of pid-file quit without updating file.
>
>
> Don't quite know if my permissions are correct of the
> /opt/local/var/db/mysql5 directory ?
>
> Current Permissions:
>
> drwx------ 8 _mysql _mysql 272 Oct 10 18:15 mysql5
Those permissions might be ok... on my development system they're 755 instead of 700 but if everything is running as the _mysql user that shouldn't matter.
Have you already referred to the MAMP how-to in our wiki?
http://trac.macports.org/wiki/howto/MAMP
More information about the macports-users
mailing list