Koozali.org: home of the SME Server

MySQL5.X on SME 7rc2

lexi

MySQL5.X on SME 7rc2
« on: May 17, 2006, 08:36:59 PM »
Hi!
It is possible to install mysql 5.0 /5.x on sme7?
which rpm / which steps are necessarily?

Thanks ahead

Offline mike_mattos

  • *
  • 313
  • +0/-0
MySQL5.X on SME 7rc2
« Reply #1 on: May 19, 2006, 04:04:35 PM »
I don't know, I'm going to try now!
...

Offline mike_mattos

  • *
  • 313
  • +0/-0
MySQL5.X on SME 7rc2
« Reply #2 on: May 19, 2006, 05:05:12 PM »
There is a how to for upgrading v3 to v4, it seems to work for upgrading v4 to v5

I used the generic LINUX statically linked, grab all the rpms from MySQL download

This was on a 'clean' SME7, now to configure for web access!

http://no.longer.valid/phpwiki/index.php/How%20to%20Upgrade%20MySQL%20to%204.0.x%20for%20SME%20Server%20feedback?action=BackLinks
...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #3 on: May 20, 2006, 10:43:04 AM »
Quote from: "mike_mattos"
http://no.longer.valid/phpwiki/index.php/How%20to%20Upgrade%20MySQL%20to%204.0.x%20for%20SME%20Server%20feedback?action=BackLinks

On first glance a quick remark to this howto. This howto is written for use on SME6 seervers, to stop and start services on SME7 the service keyword is not used. To control the mysqld server on SME7 use:
Code: [Select]
/etc/rc.d/rc7.d/S50mysqldor
Code: [Select]
/etc/rc.d/init.d/supervise/mysqld
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

lexi

MySQL5.X on SME 7rc2
« Reply #4 on: May 20, 2006, 02:34:59 PM »
I tried this way - at first it startet then i tried to reset the root password.
now mysqld does not start:

/etc/rc.d/init.d/supervise/mysqld status
/service/mysqld: down 0 seconds, want up

What can i do?

Ho can i reset the mysql password (sme-script?) the old way describes in the forum do not work.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #5 on: May 20, 2006, 05:23:13 PM »
Quote from: "lexi"
Ho can i reset the mysql password (sme-script?) the old way describes in the forum do not work.
Aaargh... why don't you people first try to search the forum befotre making the same mistakes everytime: It has been stated here many, many, many times that you don't need to (and never should) change your root password as this is 72 charachter long random string. You can simply log in using a terminal while issuing the following command:
Code: [Select]
mysql -u root
Reset your mysql root password:

[list=1]
  • Log in as root on the server console
  • Locate the mysqld.pid file, it should be here:
    Code: [Select]
    /var/run/mysqld/mysqld.pid
  • Use a kill command to kill the mysqld process:
    Code: [Select]
    kill cat /var/run/mysqld/mysqld.pid (Mind the quotes).
  • Issue the following command to display the mysql root password:
    Code: [Select]
    cat /root/.my.cnf
  • Create a text file, using pico, with the following line of code:
    Code: [Select]
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NewPassword'); and replace NewPassword with the file you obtained from the file. (TIP: If you use putty to  ssh in to the server console you can select the password and copy it with a right mouse click, this saves you typo's). Save this file for instance as as mysql.init.
  • Restart the MySQL server with the special --init-file=~/mysql-init option (Be sure to specify the correct path):
    Code: [Select]
    mysqld_safe --init-file=/path/to/mysql.init
  • The contents of the init-file are executed at server startup, changing the root password. After the server has started successfully you should delete ~/mysql-init.
  • Reboot your sever, for changes to take effect.
  • Mysql should run now and you should be able to access it from a terminal window using the following command:
    Code: [Select]
    mysql -u root[/list:o]
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

lexi

MySQL5.X on SME 7rc2
« Reply #6 on: May 20, 2006, 11:14:16 PM »
Thanx, but the first problem is that i can´t start mysqld.
If i start it directly the following error displays:

[root@v ~]# /usr/sbin/mysqld
060519  3:51:53 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

060519  3:51:53 [ERROR] Aborting

060519  3:51:53 [Note] /usr/sbin/mysqld: Shutdown complete

[root@v ~]#

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #7 on: May 20, 2006, 11:33:19 PM »
Quote from: "lexi"
Thanx, but the first problem is that i can´t start mysqld.
If i start it directly the following error displays:

[root@v ~]# /usr/sbin/mysqld
060519  3:51:53 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

060519  3:51:53 [ERROR] Aborting

060519  3:51:53 [Note] /usr/sbin/mysqld: Shutdown complete

[root@v ~]#
Did you do all the steps I described in my previous post?

If I am correct mysqld should be run as user mysql and not as user root on SMEServer. However I found this remakrs in my defaults file /etc/my.cnf:

Quote from: "/etc/my.cnf"
# The 'user' option must be in msyqld_safe/safe_mysqld section to avoid a bogus
# mysqld warning in the error log.  See http://bugs.mysql.com/2163
# NOTE: This problem is fixed in mysql >= 4.0.18, so once we get there we
# should move the 'user' option back to the [mysqld] section, and remove it
# from any mysqld invocations in our scripts.


So maybe you need to change the templates to reflect the change suggested there and remove the user parameter under the mysqld_safe section and add it under the mysqld section. Be sure to make the modification in the templates-custom directory so it will survive system upgrades and software installs, see the SME Development Guide, section II.7 for details on the template system.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

lexi

MySQL5.X on SME 7rc2
« Reply #8 on: May 21, 2006, 01:19:28 AM »
thats my my.cnf:

#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# e-smith server and gateway software. Instead, modify the source
# template in the /etc/e-smith/templates directory. For more
# information, see http://www.e-smith.org.
#
# copyright (C) 1999-2001 e-smith, inc.
#------------------------------------------------------------

[client]
password=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
------------------------------------------------------------
# TEMPLATE END
#------------------------------------------------------------

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #9 on: May 21, 2006, 10:30:47 AM »
Quote from: "lexi"
thats my my.cnf:

#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# e-smith server and gateway software. Instead, modify the source
# template in the /etc/e-smith/templates directory. For more
# information, see http://www.e-smith.org.
#
# copyright (C) 1999-2001 e-smith, inc.
#------------------------------------------------------------

[client]
password=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
------------------------------------------------------------
# TEMPLATE END
#------------------------------------------------------------
Judging by the contnet that is your /root/.my.cnf file (mind the dot for a hidden file). I really hope your mysql password is not really like that, but that there is a string of random charachters there. Those charachters are the mysql root account password and that is what should replace the NewPassword in step 5 of my instruction.

If that is the content of your /etc/my.cnf file than I think the original mysql configuration file has been overwritten or something like that. How does it read after you expand the template again for /etc/my.cnf:
Code: [Select]
expand-template /etc/my.cnfMine reads like this:
Code: [Select]
#------------------------------------------------------------
#              !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://wiki.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
###########################################################
# Here is a cheat-sheet for this file as of MySQL 4.0.14
# 2003-12-18 - tony_clayton@mitel.com
#
# 1. The mysqld binary reads options from the [mysqld] section,
#    and then overrides those values with any passed-in
#    arguments.
#
# 2. The mysqld_safe script reads options from the following
#    sections in order, overriding any previous values with newer
#    ones:
#       [mysqld] [server] [mysqld_safe] [safe_mysqld]
#    It then overrides those values with any passed-in
#    arguments, and invokes the mysqld binary (see #1 above) with
#    the resulting argument list.
#
#    * The server and safe_mysqld sections are deprecated in
#      favour of mysqld and mysqld_safe respectively.
#
# 3. The mysql or mysqld initscript reads options from the
#    following sections in order, overriding any previous values
#    with newer ones:
#       [mysqld] [mysql_server] [mysql.server]
#    It then overrides those values with any passed-in arguments,
#    and invokes the mysqld_safe script (see #2 above) with the
#    resulting argument list.
#
#    * The SMEServer doesn't have any need for initscript-only
#      options, so we don't use mysql_server and mysql.server
#      sections.
#
###########################################################

[mysqld]
pid-file=/var/run/mysqld/mysqld.pid
basedir=/usr
datadir=/var/lib/mysql
skip-innodb
socket=/var/lib/mysql/mysql.sock
skip-networking
# log-error not yet supported in our mysqld version

[mysqld_safe]
# The 'user' option must be in msyqld_safe/safe_mysqld section to avoid a bogus
# mysqld warning in the error log.  See http://bugs.mysql.com/2163
# NOTE: This problem is fixed in mysql >= 4.0.18, so once we get there we
# should move the 'user' option back to the [mysqld] section, and remove it
# from any mysqld invocations in our scripts.
user=mysql
err-log=/var/log/mysqld.log
As stated in an earlier post, you should probably have to modify the template for /etc/my.cnf to have the line
Code: [Select]
user=mysql places under the mysqld section instead of the mysql_safe section as you are trying to run MySQL 5 and that is definitely higher than 4.0.18 :-)
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #10 on: May 21, 2006, 11:03:36 PM »
Quote from: "cactus"
Quote from: "lexi"
Ho can i reset the mysql password (sme-script?) the old way describes in the forum do not work.
Aaargh... why don't you people first try to search the forum befotre making the same mistakes everytime: It has been stated here many, many, many times that you don't need to (and never should) change your root password as this is 72 charachter long random string. You can simply log in using a terminal while issuing the following command:
Code: [Select]
mysql -u root
Reset your mysql root password:

[list=1]
  • Log in as root on the server console
  • Locate the mysqld.pid file, it should be here:
    Code: [Select]
    /var/run/mysqld/mysqld.pid
  • Use a kill command to kill the mysqld process:
    Code: [Select]
    kill cat /var/run/mysqld/mysqld.pid (Mind the quotes).
  • Issue the following command to display the mysql root password:
    Code: [Select]
    cat /root/.my.cnf
  • Create a text file, using pico, with the following line of code:
    Code: [Select]
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NewPassword'); and replace NewPassword with the file you obtained from the file. (TIP: If you use putty to  ssh in to the server console you can select the password and copy it with a right mouse click, this saves you typo's). Save this file for instance as as mysql.init.
  • Restart the MySQL server with the special --init-file=~/mysql-init option (Be sure to specify the correct path):
    Code: [Select]
    mysqld_safe --init-file=/path/to/mysql.init
  • The contents of the init-file are executed at server startup, changing the root password. After the server has started successfully you should delete ~/mysql-init.
  • Reboot your sever, for changes to take effect.
  • Mysql should run now and you should be able to access it from a terminal window using the following command:
    Code: [Select]
    mysql -u root[/list:o]
While browsing throuhg the Bug Tracker I found the following way, which might be the preffered way for SMEServer 7 (it certainly is easier to do): http://bugs.contribs.org/show_bug.cgi?id=778
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
MySQL5.X on SME 7rc2
« Reply #11 on: May 21, 2006, 11:53:00 PM »
Quote from: "cactus"

Use a kill command to kill the mysqld process:
Code: [Select]
kill cat /var/run/mysqld/mysqld.pid


That won't do what you want - another mysqld process will be automatically started in its place. Please read the Developers Guide about "supervised" processes.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #12 on: May 22, 2006, 12:02:10 AM »
Quote from: "CharlieBrady"
Quote from: "cactus"

Use a kill command to kill the mysqld process:
Code: [Select]
kill cat /var/run/mysqld/mysqld.pid


That won't do what you want - another mysqld process will be automatically started in its place. Please read the Developers Guide about "supervised" processes.

Oh so this is a bit different for the SME Server... sorry I was not aware of the supervision. Used this method succesfully for other non SME servers running MySQL.
Quote from: "cactus"
While browsing throuhg the Bug Tracker I found the following way, which might be the preffered way for SMEServer 7 (it certainly is easier to do): http://bugs.contribs.org/show_bug.cgi?id=778

The other options in my post (quoted above) should work I guess as it from the bugtracker. Am I correct Charlie?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mike_mattos

  • *
  • 313
  • +0/-0
MySQL5.X on SME 7rc2
« Reply #13 on: May 27, 2006, 12:14:20 AM »
I've now tried a couple of times, reading this thread & Bug 778

Always end up WITHOUT mysqld after I reboot, this has nothing to do passwords!

I want to use MySQL5 for stored procedure development, ( I'm getting tired of mixing PHP and JavaScript routines to massage data from MySQL ), so V4 isn't an option

has anyone got MySQL5 to work ?   I'm using SME7rc2

Thanks

Mikejavascript:emoticon(':-?')
Confused
...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #14 on: May 27, 2006, 12:32:37 AM »
Quote from: "mike_mattos"
I've now tried a couple of times, reading this thread & Bug 778

Always end up WITHOUT mysqld after I reboot, this has nothing to do passwords!
How do you know? Does the error say that you entered the correct password but that it still refuses for some other reason? What about the mysql log file?

Did you also edit the contents of the /etc/my.cnf file like instructed earlier?
Quote from: "mike_mattos"
I want to use MySQL5 for stored procedure development, ( I'm getting tired of mixing PHP and JavaScript routines to massage data from MySQL ), so V4 isn't an option

has anyone got MySQL5 to work ?   I'm using SME7rc2

Thanks

Mikejavascript:emoticon(':-?')
Confused

OK I can understand that, but why not get MySQL to work on some other machine with a different OS if you want to learn and test, as you need a lot of effort to implement it here.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mike_mattos

  • *
  • 313
  • +0/-0
MySQL5.X on SME 7rc2
« Reply #15 on: May 30, 2006, 05:19:51 PM »
DID IT!  I'm posting this as a new thread , maybe someone can test it and it can be set up as a how to?   Anyway , for search purposes, I'm reposting as How To install MySQL5 on SME7



NOTE :  Do this on a fresh install, because it is likely to destroy some settings and data!

1   #  mysql
         logs in as version 4.1.12

2   mysql> quit;

3  # /etc/rc.d/init.d/supervise/mysqld status
/service/mysqld: run (pid 29128) 53510 seconds, normally down

4 # /etc/rc.d/init.d/supervise/mysqld stop
Stopping mysqld:                                           [  OK  ]

5 # /etc/rc.d/init.d/supervise/mysqld status
/service/mysqld: down 6 seconds

6 #   rpm -e mysql-server  --nodeps

7 # rpm -e mysql  --nodeps

8  Download
http://dev.centos.org/centos/4/testing/i386/RPMS/mysql-5.0.18-1.c4.i386.rpm
http://dev.centos.org/centos/4/testing/i386/RPMS/mysql-server-5.0.18-1.c4.i386.rpm

Do NOT get the versions with 5.0.18-2.1, they fail dependecies!

9 #  rpm -Uvh mysql-5.0.18-1.c4.i386.rpm

10 #   rpm -Uvh mysql-server-5.0.18-1.c4.i386.rpm

11 #  mysql  ( see what happens )
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.18

13 reboot

14  #  mysql   ( make sure it restarted automatically! )
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.18

15 Check Web Mail
A fatal error has occurred
DB Error: insufficient permissions
Details have been logged for the administrator.

16 Reset  per Charly Brady   , destroys data!!
# cd /service/mysqld
# runsvctrl d .
# /etc/e-smith/events/actions/mysql-delete-db-files
# signal-event post-upgrade
# signal event reboot

15 Check Web Mail
GOT LOGIN!!!
...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
MySQL5.X on SME 7rc2
« Reply #16 on: May 30, 2006, 11:03:29 PM »
Quote from: "mike_mattos"
NOTE :  Do this on a fresh install, because it is likely to destroy some settings and data!

How about making a backup and restoring that at the moment you have MySQL running again... have you tested that as well?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)