problem with mysql 5 install and configuration

Érico ericomtx at gmail.com
Sun Jan 8 11:54:52 PST 2012


Brandom, Lawrance and Bryan

I did the following :
1. fully reomved and cleaned mysql5-server @5.1.60_0 and mysql5 @5.1.60_0
2. ran port clean on both
3. sudo bash in my terminal
4. reinstalled running port install only for mysql5-server @5.1.60_0
5. it worked !!
6. the problem is my id ... if I try to start with it with this alias in my
.profile :
alias mysqlstart='sudo /opt/local/bin/mysqld_safe5 &'

I run $mysqlstart:
ericomtx$ mysqlstart
[1] 315
ericomtx$ ps aux | grep mysql
root       315 100.0  0.0  2436236   1668 s000  R     5:40PM   0:03.51 sudo
/opt/local/bin/mysqld_safe5
ericomtx   317   0.0  0.0  2435120    536 s000  R+    5:40PM   0:00.00 grep
mysql

*here the error:
ericomtx$ mysql5 -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/opt/local/var/run/mysql5/mysqld.sock' (2)*

ericomtx$ /opt/local/bin/mysqladmin5 -u root -p shutdown
Enter password:
/opt/local/bin/mysqladmin5: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket
'/opt/local/var/run/mysql5/mysqld.sock' (2)'
Check that mysqld is running and that the socket:
'/opt/local/var/run/mysql5/mysqld.sock' exists!

ericomtx$ ps aux | grep mysql
root       315  99.0  0.0  2436236   1668 s000  R     5:40PM   1:15.90 sudo
/opt/local/bin/mysqld_safe5
ericomtx   328   0.0  0.0  2435120    516 s000  R+    5:41PM   0:00.00 grep
mysql


ericomtx$ sudo kill -9 315

==================

when using "sudo bash" and starting it , I see these processes up :

bash-3.2# ps aux | grep mysql
root       403   0.3  0.0  2425524    172 s000  R+    5:52PM   0:00.00 grep
mysql
_mysql     378   0.0  0.4  2511112  17844 s000  S     5:42PM   0:00.24
/opt/local/libexec/mysqld --basedir=/opt/local
--datadir=/opt/local/var/db/mysql5 --user=_mysql
--log-error=/opt/local/var/db/mysql5/Ericos-MacBook-Pro.local.err
--pid-file=/opt/local/var/db/mysql5/Ericos-MacBook-Pro.local.pid
root       334   0.0  0.0  2435544    864 s000  S     5:42PM   0:00.03
/bin/sh /opt/local/bin/mysqld_safe5
bash-3.2#

I have fully removed the primary symb links, sockets file and content ...
and I have removed the files from start up also :
bash-3.2# ls -la /Library/LaunchDaemons
total 0
drwxr-xr-x   2 root  wheel    68 Jan  8 17:19 .
drwxrwxr-t+ 60 root  admin  2040 Dec  3 20:17 ..

So , is it mandatory to start it after "sudo bash" ... is there anything I
can do with my id so it can start mysql ?

Regards
Érico





2012/1/8 Érico <ericomtx at gmail.com>

> Hi Brandon
>
> thks for the reply
>
> here is the result of ericomtx$ dscl . read /Users/_mysql :
>
> AppleMetaNodeLocation: /Local/Default
> GeneratedUID: 6F0A091E-C4E0-4870-B0FE-7CE0FCBDA25D
> NFSHomeDirectory: /var/empty
> Password: *
> PrimaryGroupID: 502
> RealName:
>  MySQL Server
> RecordName: _mysql
> RecordType: dsRecTypeStandard:Users
> UniqueID: 500
> UserShell: /usr/bin/false
>
> I didn't  create these as I did with postgres id ...
>
> also the portsgres id created witn dscl is showing in "system preferences
> / accounts " ... can I remove it ? using dscl ... ?
>
> since postgres port adds the necessary id and properties ...
>
> regards
> Érico
>
>
> 2012/1/8 Brandon Allbery <allbery.b at gmail.com>
>
>> On Sun, Jan 8, 2012 at 09:33, Érico <ericomtx at gmail.com> wrote:
>>
>>> 2. my sql id ships already in the OS ? I think not, right ?
>>>
>>
>> As I said in my previous message, it's already there because OS X comes
>> with mysql.
>>
>>
>>> Was that necessary ? or when installing postgres mcaports also installs
>>> a postgres id ?
>>>
>>
>> Found in the postgresql90-server Portfile:
>>
>> destroot {
>> addgroup ${dbgrp}
>>  set gid [existsgroup ${dbgrp}]
>> adduser ${dbuser} shell=/bin/sh gid=${gid} \
>>  home=${prefix}/var/db/postgresql90 \
>> realname=PostgreSQL-90\ Server
>> xinstall -m 755 -d ${destroot}${logdir}
>>  system "touch ${destroot}${logdir}/postgres.log"
>> system "chown ${dbuser}:${dbgrp} ${destroot}${logdir}/postgres.log"
>> }
>>
>> So the port added it for you already.
>>
>> 8. back to mysql ... I have uninstalled mysql from my mac :
>>> bash-3.2# port uninstall mysql5-server @5.1.60_0
>>> bash-3.2# port uninstall mysql5 @5.1.60_0
>>>
>>> bash-3.2# port clean --all mysql5-server @5.1.60_0
>>> bash-3.2# port clean --all mysql5 @5.1.60_0
>>>
>>> I can see _mysql id is still in /etc/group file :
>>> _mysql:*:74:
>>>
>>> but it is not in /etc/passwd ....
>>>
>>> How can I fix my environment ?
>>>
>>
>> It may not need fixing.  Try "dscl . read /Users/_mysql".
>>
>>  Remember, on OS X, /etc/passwd and /etc/group are only used during boot
>> before directoryservicesd (or opendirectoryd) is running.
>>
>> If it *does* need to be re-added for some reason, mysql5-server's
>> Portfile has code similar to what I pasted above from postgresql90-server,
>> so it will recreate the user if necessary.  Still, ideally you should
>> probably not remove service users/groups; it's not like they slow the
>> system down or something, and if there's no process under that uid the only
>> way it can be accessed is via root so there's no significant security
>> aspect to leaving it around.
>>
>> --
>> brandon s allbery
>> allbery.b at gmail.com
>> wandering unix systems administrator (available)     (412) 475-9364vm/sms
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20120108/d08c3686/attachment.html>


More information about the macports-users mailing list