FAQ
Hi,
I'm trying to compile my own mysql client program under solaris 9 without luck.
I have the mysql libraries under :
/usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib and has the
following files:
libdbug.a
libmysqlclient.a
libmysqld.a
libmysys.a
libmygcc.a
libmysqlclient_r.a

Don't I need to have the libmysqlclient.so.10 file here too?
on my system the libmysqlclient.so.10 is found under directory
:/usr/local/openv/lib \
Should I move it /usr/lib instread?

Here is what I tried and the errors I get:

When the makefile has:
#L LD=gcc -lm -lmysqlclient

the error is :
symbol mysql_init: referenced symbol not found
-------------------------------------------------------------------------
When the makefile has:
#L LD=gcc -lm -Wl,r/usr/local/openv/lib -lmysqlclient

the error is :
ld: fatal: file r/usr/local/openv/lib: open failed: No such file or directory
--------------------------------------------------------------------------------------------------------
When the makefile has:
#L LD=gcc -lm -L/usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib
-lmysqlclient

the error is :
symbol mysql_init: referenced symbol not found
-------------------------------------------------------------------------

any ideas to what I'm missing ?
Thanks

Search Discussions

  • Michael Stassen at Sep 23, 2004 at 2:43 pm

    Nissim Lugasy wrote:

    Hi,
    I'm trying to compile my own mysql client program under solaris 9
    without luck.
    I have the mysql libraries under :
    /usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib and has the
    following files:
    libdbug.a
    libmysqlclient.a
    libmysqld.a
    libmysys.a
    libmygcc.a
    libmysqlclient_r.a

    Don't I need to have the libmysqlclient.so.10 file here too?
    on my system the libmysqlclient.so.10 is found under directory
    :/usr/local/openv/lib \
    Should I move it /usr/lib instread?
    I'm not sure why you'd have your libraries separated like that, but I'd make
    sure there wasn't a reason before moving one. Then I'd probably put all the
    mysql libs in the same place (i.e. move libmysqlclient.so.10),
    /usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib in your case.
    Here is what I tried and the errors I get:

    When the makefile has:
    #L LD=gcc -lm -lmysqlclient

    the error is :
    symbol mysql_init: referenced symbol not found
    It didn't find libmysqlclient.so.10.
    -------------------------------------------------------------------------
    When the makefile has:
    #L LD=gcc -lm -Wl,r/usr/local/openv/lib -lmysqlclient

    the error is :
    ld: fatal: file r/usr/local/openv/lib: open failed: No such file or
    directory
    It still didn't find libmysqlclient.so.10, apparently because you have the
    syntax wrong.
    --------------------------------------------------------------------------------------------------------

    When the makefile has:
    #L LD=gcc -lm
    -L/usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib -lmysqlclient

    the error is :
    symbol mysql_init: referenced symbol not found
    It didn't find libmysqlclient.so.10, because you told it to look in the
    wrong place.
    -------------------------------------------------------------------------

    any ideas to what I'm missing ?
    Thanks
    Try specifying the correct path with -L:

    #L LD=gcc -lm -L/usr/local/openv/lib -lmysqlclient

    You may also need -R /usr/local/openv/lib so that your executable knows
    where to find libmysqlclient.so.10 at run time.

    Michael
  • Leegold at Sep 23, 2004 at 4:12 pm
    alter table keywords change key_id page_id int(10) unsigned NOT NULL PK
    auto_increment;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the
    manual that corresponds to your MySQL server version for the right
    syntax to use near 'PK auto_increment' at line 1

    I'm trying to change the name of a column, but I have to also "restate"
    the type and sttribute on the column while i do that AFAIK. Can someone
    show me my syntax error? The statement above is exactlymy try from the
    mysql comd. line Thanks.
  • Paul DuBois at Sep 23, 2004 at 8:52 pm

    At 12:12 -0400 9/23/04, leegold wrote:
    alter table keywords change key_id page_id int(10) unsigned NOT NULL PK
    auto_increment;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the
    manual that corresponds to your MySQL server version for the right
    syntax to use near 'PK auto_increment' at line 1

    I'm trying to change the name of a column, but I have to also "restate"
    the type and sttribute on the column while i do that AFAIK. Can someone
    show me my syntax error? The statement above is exactlymy try from the
    mysql comd. line Thanks.
    The problem is shown by the error message: PK isn't valid.
    Do you mean PRIMARY KEY?

    --
    Paul DuBois, MySQL Documentation Team
    Madison, Wisconsin, USA
    MySQL AB, www.mysql.com
  • Leegold at Sep 23, 2004 at 9:12 pm

    On Thu, 23 Sep 2004 15:51:56 -0500, "Paul DuBois" <paul@mysql.com> said:
    At 12:12 -0400 9/23/04, leegold wrote:
    alter table keywords change key_id page_id int(10) unsigned NOT NULL PK
    auto_increment;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the
    manual that corresponds to your MySQL server version for the right
    syntax to use near 'PK auto_increment' at line 1

    I'm trying to change the name of a column, but I have to also "restate"
    the type and sttribute on the column while i do that AFAIK. Can someone
    show me my syntax error? The statement above is exactlymy try from the
    mysql comd. line Thanks.
    The problem is shown by the error message: PK isn't valid.
    Do you mean PRIMARY KEY?
    Yes. Fixed it, Thanks.
  • Michael Stassen at Sep 23, 2004 at 11:45 pm
    First, you should keep threads on the list.

    Second, I'm confused. Didn't you say that you already have
    libmysqlclient.so.10 in /usr/local/openv/lib?

    If you need to get a new one, it apppears that to get it on Solaris, you
    need to build from source.

    Michael

    Nissim Lugasy wrote:
    where can I download mysql 4.0 for solaris9 that include the shared
    library?
    I downloaded mysql-max-4.0.21-sun-solaris2.9-sparc.tar.gz and I did not see
    libmysqlcleint.so.10 file in the mysql/lib directory.

    At 10:42 AM 9/23/2004 -0400, you wrote:

    Nissim Lugasy wrote:
    Hi,
    I'm trying to compile my own mysql client program under solaris 9
    without luck.
    I have the mysql libraries under :
    /usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib and has the
    following files:
    libdbug.a
    libmysqlclient.a
    libmysqld.a
    libmysys.a
    libmygcc.a
    libmysqlclient_r.a
    Don't I need to have the libmysqlclient.so.10 file here too?
    on my system the libmysqlclient.so.10 is found under directory
    :/usr/local/openv/lib \
    Should I move it /usr/lib instread?

    I'm not sure why you'd have your libraries separated like that, but
    I'd make sure there wasn't a reason before moving one. Then I'd
    probably put all the mysql libs in the same place (i.e. move
    libmysqlclient.so.10),
    /usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib in your case.
    Here is what I tried and the errors I get:
    When the makefile has:
    #L LD=gcc -lm -lmysqlclient
    the error is :
    symbol mysql_init: referenced symbol not found

    It didn't find libmysqlclient.so.10.
    -------------------------------------------------------------------------

    When the makefile has:
    #L LD=gcc -lm -Wl,r/usr/local/openv/lib -lmysqlclient
    the error is :
    ld: fatal: file r/usr/local/openv/lib: open failed: No such file or
    directory

    It still didn't find libmysqlclient.so.10, apparently because you have
    the syntax wrong.
    --------------------------------------------------------------------------------------------------------

    When the makefile has:
    #L LD=gcc -lm
    -L/usr/local/mysql-standard-4.0.20-sun-solaris2.9-sparc/lib
    -lmysqlclient
    the error is :
    symbol mysql_init: referenced symbol not found

    It didn't find libmysqlclient.so.10, because you told it to look in
    the wrong place.
    -------------------------------------------------------------------------

    any ideas to what I'm missing ?
    Thanks

    Try specifying the correct path with -L:

    #L LD=gcc -lm -L/usr/local/openv/lib -lmysqlclient

    You may also need -R /usr/local/openv/lib so that your executable
    knows where to find libmysqlclient.so.10 at run time.

    Michael
  • /dev/null at Sep 28, 2004 at 12:29 am
    We've got about 1,000 records in a table that have timestamps on them.
    We've ran into a situation where we need to go back and update one field in
    all of those records without altering the timestamp. since the timestamp is
    automatically changed when the record is updated we are in a bind.

    The sql we need to run is "UPDATE `table` SET `AID` = 2 WHERE `SID` = 5"

    Is there a way to do this sort of update but tell mysql to leave the
    timestamps alone?

    Maybe by copying the table to backup and then back again (only I can't
    figure out the sql to do that)?

    Thanks for any and all help.
  • Michael Stassen at Sep 28, 2004 at 4:06 am
    The simple solution is to explicitly set the timestamp column to the value
    it already has. Assuming Time is your timestamp column, you need:

    UPDATE `table`
    SET `AID` = 2, Time = Time
    WHERE `SID` = 5;

    See the manual for more
    <http://dev.mysql.com/doc/mysql/en/TIMESTAMP_pre-4.1.html>.

    Michael

    /dev/null wrote:
    We've got about 1,000 records in a table that have timestamps on them.
    We've ran into a situation where we need to go back and update one field in
    all of those records without altering the timestamp. since the timestamp is
    automatically changed when the record is updated we are in a bind.

    The sql we need to run is "UPDATE `table` SET `AID` = 2 WHERE `SID` = 5"

    Is there a way to do this sort of update but tell mysql to leave the
    timestamps alone?

    Maybe by copying the table to backup and then back again (only I can't
    figure out the sql to do that)?

    Thanks for any and all help.
  • /dev/null at Sep 28, 2004 at 12:39 am
    Never mind, I just figured it out:

    First, I copied the whole 'hits' table to 'hits_bak', then ran this:

    INSERT INTO `csrtech_dirserv`.`hits`
    SELECT `SID` , 2 AS `AID` , `Phrase` , `IP` , `Link` , `Time` ,
    `Amt` , `F`
    FROM `csrtech_dirserv`.`hits_bak`
    WHERE `SID` =5

    So that coppied all fields except AID, which it set to 2.

    Hope this helps someone else!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmysql @
categoriesmysql
postedSep 23, '04 at 12:04p
activeSep 28, '04 at 4:06a
posts9
users5
websitemysql.com
irc#mysql

People

Translate

site design / logo © 2022 Grokbase