Koozali.org: home of the SME Server

How to install MySQL5 on SME7

Offline mike_mattos

  • *
  • 313
  • +0/-0
How to install MySQL5 on SME7
« Reply #30 on: August 29, 2006, 05:24:09 PM »
why not yum?    well, I used yum on a CentOS system with no problems,

yum update mysql  and yum update php both work without breaking anything on CentOS

 but got errors using yum on SME, even after enabling Centosplss.  ( It retrieved MySQL5 but then gave errors )

The CentOS site has many posts and links saying which repositories have which features, and also how to add to the repositories, but I'm not finding that information on this site.  How would one know that MySQL is in CentosPlus and not in centos testing,  or sme testing?

Is there an SME yum guide to explain the differences between SME and CentOS repositories, and how to enable them?  On Centos the ini file is edited, that doesn't seem to be the sme method
...

Offline jfarschman

  • *
  • 406
  • +0/-0
How to install MySQL5 on SME7
« Reply #31 on: August 30, 2006, 03:44:40 PM »
Mike,

  Yum is like an UNIX command.  Flexible to the point that it's frustrating the first few times you use it.  Once you get over that hump it saves time. Yum sure is good with dependencies.

  Here's what I do:

NEED TO MY INSTALLED REPOSITORIES?
db yum_repositories show |grep repository

NEED TO FIND IF AN RPM IS IN A REPO?
yum search --enablerepo=<reponame>

NEED TO INSTALL FROM A NON STANDARD REPO?
yum install --enablerepo=<reponame>

or update or remove

NEED TO TURN ON A REPO FULL TIME
Use caution here... because, as you discussed, you don't know what's in a repo and could update things you don't want updated.

db yum_repositories setprop centosplus Visible yes
db yum_repositories setprop centosplus status enabled
expand-template /etc/yum.conf

EXCLUDE AN RPM FROM UPADATING FROM A PARTICULAR REPO?
For instance you are using an openldap that is likely to be overwritten by a SME update one of your "enabled" repos.

db yum_repositories setprop base Exclude openldap*
db yum_repositories setprop updates Exclude openldap*
db yum_repositories setprop smeos Exclude openldap*
expand-template /etc/yum.conf

Hope this helps.
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Offline mike_mattos

  • *
  • 313
  • +0/-0
How to install MySQL5 on SME7
« Reply #32 on: August 30, 2006, 11:08:36 PM »
thx, I'll poke around at it

one question though, how do you get the "name" to search?  That  is to say, if you wanted to update MySQL from 4.0 to 4.1   and not to 5.0, or wanted to know if there was an update for an application, how do you see the rpm version info?

Is there a generic site for yum to search the way you can search for rpm's or distro's or dll's?


thx again
...

Offline jfarschman

  • *
  • 406
  • +0/-0
How to install MySQL5 on SME7
« Reply #33 on: August 30, 2006, 11:34:14 PM »
yum search --enablerepo=<reponame>

Unfortunately... this will come up with lots of answers... mysql-client is easier to find... returns fewer results.
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Offline Rien

  • *
  • 216
  • +0/-0
    • http://www.taurix.nl
Error mysql.init during reboot
« Reply #34 on: September 01, 2006, 12:09:49 AM »
I use SME7 + MySQL 5.0.22

It works fine but when I reboot I get the following error:

Quote
Starting mysql.init: Loading 30mysql_create_tables into MySQL. Error 2013 (HY000) at line 11: Lost connection to MySQL server during query [FAILED][FAILED]



I looked into 30mysql_create_tables:
Code: [Select]
CREATE DATABASE IF NOT EXISTS horde;

CONNECT horde;

CREATE TABLE IF NOT EXISTS horde_users (
    user_uid       varchar(255) not null,
    user_pass      varchar(32) not null,
    primary key (user_uid)
);

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_users TO horde@localhost;

CREATE TABLE IF NOT EXISTS horde_prefs (
    pref_uid        char(255) not null,
    pref_scope      char(16) not null default '',
    pref_name       char(32) not null,
    pref_value      text null,
    primary key (pref_uid, pref_scope, pref_name)
);

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_prefs TO horde@localhost;

CREATE TABLE IF NOT EXISTS horde_categories (
       category_id INT not null,
       group_uid VARCHAR(255) not null,
       user_uid VARCHAR(255),
       category_name VARCHAR(255) not null,
       category_data TEXT null,
       category_serialized SMALLINT DEFAULT 0 not null,
       category_updated TIMESTAMP,
       PRIMARY KEY (category_id)
);

CREATE TABLE IF NOT EXISTS horde_categories_categories (
       category_id_parent INT not null,
       category_id_child INT not null,
       PRIMARY KEY (category_id_parent, category_id_child)
);

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_categories TO horde@localhost;
GRANT SELECT, INSERT, UPDATE, DELETE ON horde_categories_categories TO horde@localhost;

FLUSH PRIVILEGES;


When I tried to execute this query from PhpMyAdmin it gives the following error:
Quote
#1064 - 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 'CONNECT horde' at line 1



What could be wrong?

Thanks,
Rien
(The Netherlands)......

Offline Jean-Philippe Pialasse

  • *
  • 2,721
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
How to install MySQL5 on SME7
« Reply #35 on: September 01, 2006, 01:17:30 AM »
hi here something funny:

this commands
Code: [Select]
GRANT SELECT, INSERT, UPDATE, DELETE ON horde_users TO horde@localhost does not seem to be accepted by mysql 5 on SME ...


it is from the dump /home/e-smith/httpd/horde/scripts/db/mysql_create_tables.sql
it called by /etc/e-smith/sql/init/30mysql_create_tables
which is called when you do
/etc/rc.d/init.d/mysql.init restart

one othe rtable forgotten :

DROP TABLE IF EXISTS procs_priv;
CREATE TABLE procs_priv (
  Host char(60) collate utf8_bin NOT NULL default '',
  Db char(64) collate utf8_bin NOT NULL default '',
  User char(16) collate utf8_bin NOT NULL default '',
  Routine_name char(64) collate utf8_bin NOT NULL default '',
  Routine_type enum('FUNCTION','PROCEDURE') collate utf8_bin NOT NULL,
  Grantor char(77) collate utf8_bin NOT NULL default '',
  Proc_priv set('Execute','Alter Routine','Grant') character set utf8 NOT NULL default '',
  Timestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (Host,Db,User,Routine_name,Routine_type),
  KEY Grantor (Grantor)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges';

and after it works !!!!!!!!!!!!!!

Offline kruhm

  • *
  • 680
  • +0/-0
How to install MySQL5 on SME7
« Reply #36 on: September 01, 2006, 02:12:58 AM »
@mike_mattos
Yum searches are not case sensitive. The following search will pull a list of every rpm in a repo that has mysql in the name or description:
#yum search --enablerepo=extras mysql

Yum installs are case sensitive and version sensitive.
#yum install mysql.i386-4.1.20-1.RHEL4.1

The following will show more:
#man yum

Offline Rien

  • *
  • 216
  • +0/-0
    • http://www.taurix.nl
How to install MySQL5 on SME7
« Reply #37 on: September 01, 2006, 05:06:29 PM »
So what you have to do to install MySQL 5 on SME7 is:


==============================
STEP 1: MAKE A BACKUP OF YOUR DATABASES:
==============================

Code: [Select]
mysqldump -aec >backup_mysql_databases.sql



==========================
STEP 2: GET THE NEW RPM'S:
==========================

THERE ARE TWO WAYS OF DOING THIS:

-------------
FIRST METHOD:
-------------

Code: [Select]
wget \
http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysqlclient14-4.1.14-4.2.c4.1.i386.rpm \
http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysql-server-5.0.22-1.centos.1.i386.rpm \
http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysql-5.0.22-1.centos.1.i386.rpm

rpm -U mysql-5.0.22-1.centos.1.i386.rpm \
mysql-server-5.0.22-1.centos.1.i386.rpm \
mysqlclient14-4.1.14-4.2.c4.1.i386.rpm


Code: [Select]
/etc/rc.d/init.d/mysqld stop
rm -f /etc/my.cnf.rpmnew
/etc/rc.d/init.d/mysqld start


To fix the privileges on Horde:

Code: [Select]
mysql -e "GRANT SELECT,INSERT,UPDATE,DELETE ON horde.* TO 'horde'@'localhost';FLUSH PRIVILEGES"

-------------------------
SECOND METHOD: (prefered)
-------------------------

Code: [Select]
/etc/rc.d/init.d/mysqld stop
yum --enablerepo=centosplus update mysql
/etc/rc.d/init.d/mysqld start


To fix the privileges on Horde:

Code: [Select]
mysql -e "GRANT SELECT,INSERT,UPDATE,DELETE ON horde.* TO 'horde'@'localhost';FLUSH PRIVILEGES"




===================================================
STEP 3: ADD MISSING MySQL-TABLES TO MYSQL DATABASE: (for instance with PhpMyAdmin)
===================================================

Code: [Select]
DROP TABLE IF EXISTS proc;
CREATE TABLE proc (
db char( 64 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
name char( 64 ) NOT NULL default '',
type enum( 'FUNCTION', 'PROCEDURE' ) NOT NULL ,
specific_name char( 64 ) NOT NULL default '',
language enum( 'SQL' ) NOT NULL default 'SQL',
sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) NOT NULL default 'CONTAINS_SQL',
is_deterministic enum( 'YES', 'NO' ) NOT NULL default 'NO',
security_type enum( 'INVOKER', 'DEFINER' ) NOT NULL default 'DEFINER',
param_list blob NOT NULL ,
returns char( 64 ) NOT NULL default '',
body longblob NOT NULL ,
definer char( 77 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
created timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
modified timestamp NOT NULL default '0000-00-00 00:00:00',
sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) NOT NULL default '',
comment char( 64 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
PRIMARY KEY ( db , name , type )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COMMENT = 'Stored Procedures';

DROP TABLE IF EXISTS procs_priv;
CREATE TABLE procs_priv (
Host char(60) collate utf8_bin NOT NULL default '',
Db char(64) collate utf8_bin NOT NULL default '',
User char(16) collate utf8_bin NOT NULL default '',
Routine_name char(64) collate utf8_bin NOT NULL default '',
Routine_type enum('FUNCTION','PROCEDURE') collate utf8_bin NOT NULL,
Grantor char(77) collate utf8_bin NOT NULL default '',
Proc_priv set('Execute','Alter Routine','Grant') character set utf8 NOT NULL default '',
Timestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (Host,Db,User,Routine_name,Routine_type),
KEY Grantor (Grantor)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges';



======================
STEP 4: RESTART MySQL:
======================

You simply reboot the server

OR

without rebooting the server:

Code: [Select]
/etc/rc.d/init.d/mysqld stop;
/etc/rc.d/init.d/mysqld start;
/etc/rc.d/init.d/mysql.init restart;


===========================================
Is this correct?
Rien
(The Netherlands)......

Offline Jean-Philippe Pialasse

  • *
  • 2,721
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
How to install MySQL5 on SME7
« Reply #38 on: September 01, 2006, 05:18:26 PM »
correct no more to add, the perfect how to .


---

and stop flood, just  open a new topic for YUM discusions, thank you.

munter

How to install MySQL5 on SME7
« Reply #39 on: September 02, 2006, 01:40:55 PM »
this is what i got after wget all 3:

[root@jttrade lib]# rpm -U mysql-5.0.22-1.centos.1.i386.rpm
error: Failed dependencies:
        libmysqlclient.so.14 is needed by (installed) perl-DBD-MySQL-2.9004-3.1.i386
        libmysqlclient.so.14 is needed by (installed) dovecot-0.99.14-1.2.el4.rf.i386
        libmysqlclient.so.14 is needed by (installed) mysql-server-4.1.20-1.RHEL4.1.i386
        libmysqlclient.so.14 is needed by (installed) php-mysql-4.3.9-3.15.i386
        libmysqlclient.so.14(libmysqlclient_14) is needed by (installed) mysql-server-4.1.20-1.RHEL4.1.i386
        libmysqlclient.so.14(libmysqlclient_14) is needed by (installed) php-mysql-4.3.9-3.15.i386
        libmysqlclient_r.so.14 is needed by (installed) mysql-server-4.1.20-1.RHEL4.1.i386
        libmysqlclient_r.so.14(libmysqlclient_14) is needed by (installed) mysql-server-4.1.20-1.RHEL4.1.i386
        mysql = 4.1.20-1.RHEL4.1 is needed by (installed) mysql-server-4.1.20-1.RHEL4.1.i386

munter

How to install MySQL5 on SME7
« Reply #40 on: September 02, 2006, 02:03:21 PM »
are there any easy way to install this?

php-domxml is needed by package e-smith-horde

tryed

wget ftp://download.fedora.redhat.com/pub/fedora/linux/core/updates/2/SRPMS/php-4.3.10-2.4.src.rpm

rpm -U php-4.3.10-2.4.src.rpm

trying to install mysql but fails everytime

Offline Jean-Philippe Pialasse

  • *
  • 2,721
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
How to install MySQL5 on SME7
« Reply #41 on: September 02, 2006, 02:20:10 PM »
Quote from: "munter"
are there any easy way to install this?

php-domxml is needed by package e-smith-horde

tryed

wget ftp://download.fedora.redhat.com/pub/fedora/linux/core/updates/2/SRPMS/php-4.3.10-2.4.src.rpm

rpm -U php-4.3.10-2.4.src.rpm

trying to install mysql but fails everytime


Are you trying to update MYSQL or PHP ?

Rien was saying for the without yum methode:
Code: [Select]
rpm -U mysql-5.0.22-1.centos.1.i386.rpm \
mysql-server-5.0.22-1.centos.1.i386.rpm \
mysqlclient14-4.1.14-4.2.c4.1.i386.rpm


Which doesn't mean
Code: [Select]
rpm -U mysql-5.0.22-1.centos.1.i386.rpm
then
Code: [Select]
rpm -U mysql-server-5.0.22-1.centos.1.i386.rpm
then
Code: [Select]
rpm -U mysqlclient14-4.1.14-4.2.c4.1.i386.rpm

so copy and paste the 3 lines in one time and execute.

BUT I suggest you the easier methode : the yum one:
Code: [Select]
/etc/rc.d/init.d/mysqld stop
yum --enablerepo=centosplus update mysql
/etc/rc.d/init.d/mysqld start


The update of PHP is a little more complicated, and it is even more difficult when youy use a source RPM :)[/code]

munter

How to install MySQL5 on SME7
« Reply #42 on: September 02, 2006, 04:25:25 PM »
Thank you...this was helpful.
Now i understand the syntax.

But still doesnt apply on my server.

Te goal is to run it as a webserver ontop of all feature  like mail, ftp, firewall, printer-server.

I want this webserver to host my website written in php.

I understud the other part with hosting several domains.

Offline Jean-Philippe Pialasse

  • *
  • 2,721
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
How to install MySQL5 on SME7
« Reply #43 on: September 02, 2006, 08:03:44 PM »
Munter,

there's already PHP4 and mysql 4 to run a website in php on sme 7.

do you absolutly need to update to mysql 5 ?

if yes what return the try with yum ?

Code: [Select]
/etc/rc.d/init.d/mysqld stop
yum --enablerepo=centosplus update mysql
/etc/rc.d/init.d/mysqld start

munter

How to install MySQL5 on SME7
« Reply #44 on: September 04, 2006, 09:45:04 AM »
Quote from: "unnilennium"
Munter,

there's already PHP4 and mysql 4 to run a website in php on sme 7.

do you absolutly need to update to mysql 5 ?

if yes what return the try with yum ?

Code: [Select]
/etc/rc.d/init.d/mysqld stop
yum --enablerepo=centosplus update mysql
/etc/rc.d/init.d/mysqld start


First of all, thanks for trying help me.

Did trye yum but it also complaining about this: Error: Missing Dependency: php-domxml is needed by package e-smith-horde
================================================================
No new rpms were installed. No additional commands are required.
================================================================
[root@jttrade ~]# /etc/rc.d/init.d/mysqld start

Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]


its not really important to upgrade to ver5 but now doesnt mysql start at all :-)

maybe i should reinstall my server and be happy with ver 4.
I do have some small issues with password streangth and backup.
So i think we save some time to reinstall this time.

After that i need to learn howto manage mysql and php on my server aswell... dont have any knowlege in manage mysql.... just use it on an expensive payserver