MySQL Instal Errors

hembeck

Registered
Hey all,
I'm trying to install the .pkg version of MySQL as found on Marc Liyanage's site, following the instructions that he laid out, but I'm hitting a snag at step 7, where I type in "sudo ./bin/safe_mysqld --user=mysql &" I get the following:
Code:
[localhost:/usr/local/mysql] fernando% Starting mysqld daemon with databases from /usr/local/mysql/data
020821 18:15:23  mysqld ended
And that's it...I wait and wait and wait to see if something happens, but nothing does.

The only clue I know to offer is this error that is reported following step 2, "sudo ./scripts/mysql_install_db":
Code:
:Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
[B]ERROR: 1062  Duplicate entry 'localhost-root' for key 1
ERROR: 1062  Duplicate entry 'localhost-root' for key 1[/B]
020821 18:14:06  ./bin/mysqld: Shutdown Complete
I've removed the installation using Marc's removal script ad have also deleted the MySQL user. (I've done this 3 times already, always with the same results that I've noted above.)

Please, any help!!
-Fernando :confused:
 
Hmm, I'm no expert but it seems to me that it maybe something to do with the default user database that gets installed with MySQL (the database is called mysql and contains the data of allowable users within MySQL)... is seems to prepare the tables for this database but halt because of something to do with the root user @localhost... duplicate entry? At a guess, maybe the uninstall didn't completely eradicate all the previous data, so when the package tries to create the user information, it finds an unmoveable duplicate.

Again this is a guestimate, rather than an expert talking, but, you can try to see if that data exist by doing the following (non-harmful;) ):

In the terminal type:

cd /usr/local/
ls

Can you see a directory called mysql? If so, then do:

cd mysql
ls


Now, can you see a directory called data? If so, then you can also cd into there and that is where you would find the mysql database data.

If this is the case, you could try deleting the data with:



sudo rm -r mysql

... but again, I would wait for confirmation from someone other than me, to tell you if I am right or not (if I'm wrong then sorry to take up your time:rolleyes: :D )
 
Thanks just the same, uoba. At least you're giving me a lead. I've posted all throughout the known Mac OS X community, and no one has said peep. I don't know if it's because I'm an obvious newbie or this is a real queer problem.

Thanks again. I'll give your suggestion a try.

-Fernando
 
Uoba,

I gave it a shot and the mysql directory is gone, so the uninstall worked. I was hopeful with you're post. Now I'm back to being perplexed. :confused:

I think I may try the compile the source for mysql, rather than using the pkg installer.

-Fernando
 
I do not know if this will be of any help, but ...

I was using the MySQL package from Marc Liyanage's site before I install OS X 10.2. Everything was going along fine...until I install 10.2 yesterday.

As I looked around to see what was up I notice that 10.2 had removed my MySQL user account from the "Accounts" in my System Settings panel (sorry if the names are incorrect here, but I am using a Japanese Mac and everything is in Japanese). However, the MySQL user information was still in the "Netinfo Manager". Only, the home and shell had been set to /dev/null.

This is not what they originally where, so I reset them ...
home /Users/mysql
shell /bin/tcsh

After doing this I downloaded Marc Liyanage's mysql-3.23.51-jaguar.pkg.tar.gz, and followed his instructions.

Everything seems to be back in working order now. :)


....BTW....while this is not MySQL trouble, my TOMCAT set up also need fixing thanks to 10.2!
 
Ah, the ironey of it all, I now have the same problem as you hembeck on my iMac at home... I'm having a look now (mntmago's suggestion doesn't help for this problem):(
 
Okay, you need to check you .err files to see what your particular problem is, to do this type:

cd /usr/local/mysql/data/


Here you should see the error files (usually your localhost address suffixed with the .err. Then type:

pico errorfilename.err


... replacing the errorfilename with the fil ename of course;)

What's yours say?
 
My MySQL is seemingly up and running but I cannot connect with the 'mysql' command!
 
Originally posted by uoba
My MySQL is seemingly up and running but I cannot connect with the 'mysql' command!

Question...what do you mean by "seemingly"?

Did you do a ls -la /tmp , and check for the socket...if that is what it is called.

Did you try a ps aux | grep mysql to see if the process was running?

Also, mysql seems to be a stickler for access permissions, but when you tried to connect did you use the following format...?

mysql -D someDatabase_name -u someUser_name -p

Did you try to access from the user that owns mysql?

....can't think of anything else right of hand, so I hope the above helps.

m(_ _)m
 
By seemingly working I mean:

[localhost:/usr/local/mysql] martin% ./bin/mysqladmin version
./bin/mysqladmin Ver 8.23 Distrib 3.23.51, for apple-darwin6.0 on powerpc
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 3.23.51-entropy.ch
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 14 min 59 sec

Threads: 1 Questions: 1 Slow queries: 0 Opens: 5 Flush tables: 1 Open tables: 0 Queries per second avg: 0.001


... shows as being up and running.

However when I try the mysql command or even mysql -u root -p or whatever I just get the message 'mysql: command not found'!

Anyway, here's the ps aux | grep mysql info:


root 399 0.0 0.1 1828 576 p1 S 7:34AM 0:00.04 sh ./bin/safe_mysqld
mysql 416 0.0 0.1 12028 956 p1 S 7:34AM 0:00.04 /usr/local/mysql/bin/m
user 539 0.0 0.0 1416 308 std S+ 9:03AM 0:00.01 grep mysql
 
Dudddeeee!!!

Just did a:
./mysql

which opened MySQL!!!

This only from the usr/local/mysql/bin directory... any other directory will deny permisson!
 
Originally posted by uoba
Dudddeeee!!!

Just did a:
./mysql

which opened MySQL!!!

This only from the usr/local/mysql/bin directory... any other directory will deny permisson!

I am at work now, so I don't have my notes at hand. Yet, if memory serves me correctly connecting to mysql without giving a DB to connect to means that you are so of "connected but not connected".

Did you get a mysql prompt .... ?
mysql >

If you did, try a show databases and see what you get. If it gives you a list, then use help to get a list of terms and choose the one (again I for get what it is) that will connect you to a DB.

EX.
mysql > \c myDB

...where \c tells to mysql to connect to myDB database.

m(_ _)m
 
Cheers mntamago

I am pretty much adept at using mysql in the command line, pre to 10.2 the 'mysql' command (or rather mysql -u username -p' ) would take you into MySQL. However, 10.2 has seemingly stopped this (hence the above post).

My MySQL is working, as the standard mysql and test databases are in there. Perhaps it something to do with the tcsh file commands (no mysql entry?):confused:
 
uoba

You stated something that got me wondering.

"My MySQL is working, as the standard mysql and test databases are in there. Perhaps it something to do with the tcsh file commands (no mysql entry?)"

What do you mean by no mysql entry?

One thing I found was that after 10.2 installation, my $PATH would no longer print out mysql or postgres and such other open source software that I have installed.

What I had to do was add then /usr/local/bin and /usr/local/sbin to /etc/csh.login:

setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
set autolist

After doing this, and reopening the terminal, "which mysql" etc returned to its normal self again - i.e. it again gives me the paths to my non-Apple installed open source software.
 
Hey all,

I guess I'm not the only one perplexed by mysql! On my orginal post, I was getting Error 1062, stating that localhost was being written twice to key 1, and because I seemingly (there's that word again) could not log on, I assumed that was crapping mysql out. I believe I may have been wrong.

Because It took a while to get this thread going, and posts to other OS X boards proved pointless (no responses) I went out and got a book. It seems that because I wasn't properly requesting to input a password, by inputting mysqld -u mysql -p, I wasn't able to log on. That, though, does not explain away the Error 1062, which I still feel will come back to haunt me. An error just can't be good.

I'll keep an eye on this thread, because there's some knowledge tranfering going on here.

-Fernando
 
To find out why the demon stopped, check your .err log which should be in the data folder. Sometimes that gives you a hint. I have noted that you have to play with the permissions (mysql or whatever user you have the process run).

Personally, I also had some problems since I upgraded to Jaguar. My current mysqld is working and I can access the databases fine through a PHPAdmin interface. However, when I try to load mysql from the commandline, I get the following message:

dyld: ./mysql Undefined symbols:
./mysql undefined reference to _BC expected to be defined in /usr/lib/libSystem.B.dylib
./mysql undefined reference to _PC expected to be defined in /usr/lib/libSystem.B.dylib
./mysql undefined reference to _UP expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

To get things back in order, I tried to recompile my mysql source, which had worked before, but now I am getting the following error:

Making all in client

... Stuff deleted...

readline/libreadline.a ../libmysql/.libs/libmysqlclient.a -lz -lm -lz -lm
ld: Undefined symbols:
_tgoto
_tputs
_tgetent
_tgetflag
_tgetnum
_tgetstr
make[2]: *** [mysql] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2

So, if anyone smarter than me can help, let me know!

Andreas
 
New install of 10.2, re-installed mysql. Like others, I get this when trying to access from commandline:

dyld: ./bin/mysql Undefined symbols:
./bin/mysql undefined reference to _BC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _PC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _UP expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

The mysqld is running, but I can't cmdline it. Installed 'off the shelf' from Marc Liayanage's http://www.entropy.ch/software/macosx/mysql/

Has anybody found a fix for this?
 
I have successfully installed the binary distribution from http://www.entropy.ch. Works like a charm.

Would still like to know why Jaguar breaks both the old compiled mysql and does not allow a source compile (at least not with 3.23.52). Perhaps someone can enlighten us.

Andreas
 
Originally posted by flash
New install of 10.2, re-installed mysql. Like others, I get this when trying to access from commandline:

dyld: ./bin/mysql Undefined symbols:
./bin/mysql undefined reference to _BC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _PC expected to be defined in /usr/lib/libSystem.B.dylib
./bin/mysql undefined reference to _UP expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

The mysqld is running, but I can't cmdline it. Installed 'off the shelf' from Marc Liayanage's http://www.entropy.ch/software/macosx/mysql/

Has anybody found a fix for this?

Marc has installation instructions for 10.2 & 10.X. Did you use the instructions for 10.2? It can be easily missed. ;)

-fernando
 
Back
Top