LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-06-2009, 06:15 AM   #1
ngohieutp
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Rep: Reputation: 0
Unhappy How to install mysql on CentOS


Huhu, I want to install mysql on CentOS 4.5.
Now I have some package :

Quote:
[root@localhost hieund]# ls
mysql-5.0.22-1.centos.1.i386.rpm
mysql-5.0.27-1.el4.centos.i386.rpm
mysql-5.0.42-1.el4.centos.i386.rpm
mysql-5.0.44-1.el4.centos.i386.rpm
mysql-5.0.46-1.el4.centos.i386.rpm
mysql-5.0.48-1.el4.centos.i386.rpm
mysqlclient10-3.23.58-9.2.c4.i386.rpm
mysqlclient10-devel-3.23.58-9.2.c4.i386.rpm
mysqlclient14-4.1.14-4.2.c4.1.i386.rpm
mysqlclient14-4.1.22-1.el4s1.1.i386.rpm
mysqlclient14-devel-4.1.14-4.2.c4.1.i386.rpm
mysqlclient14-devel-4.1.22-1.el4s1.1.i386.rpm
mysql-devel-5.0.22-1.centos.1.i386.rpm
mysql-devel-5.0.27-1.el4.centos.i386.rpm
mysql-devel-5.0.42-1.el4.centos.i386.rpm
mysql-devel-5.0.44-1.el4.centos.i386.rpm
mysql-devel-5.0.46-1.el4.centos.i386.rpm
mysql-devel-5.0.48-1.el4.centos.i386.rpm
mysql-libs-5.0.48-1.el4.centos.i386.rpm
mysql-server-5.0.22-1.centos.1.i386.rpm
mysql-server-5.0.27-1.el4.centos.i386.rpm
mysql-server-5.0.42-1.el4.centos.i386.rpm
mysql-server-5.0.44-1.el4.centos.i386.rpm
mysql-server-5.0.46-1.el4.centos.i386.rpm
mysql-server-5.0.48-1.el4.centos.i386.rpm
I don't know much about Linux, but i must install MySql on it. This is my command
Quote:
[root@localhost hieund]# rpm -ivh mysql-server-5.0.48-1.el4.centos.i386.rpm
warning: mysql-server-5.0.48-1.el4.centos.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
mysql = 5.0.48-1.el4.centos is needed by mysql-server-5.0.48-1.el4.centos.i386
And
Quote:
[root@localhost hieund]# yum install mysql-server-5.0.48-1.el4.centos.i386.rpm
Setting up Install Process
Setting up repositories
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update
Anyone please tell me the way to get out of this trouble, please ????
 
Old 08-06-2009, 07:08 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Just use yum install mysql-server.
 
Old 08-06-2009, 08:05 AM   #3
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
Hello!

You first tried to use rpn ( which is OK because you have the packages ) but then tried to install using yum - which wont work are none of your repo's are set up.

To install mysql server type:

Code:
rpm -ivh mysql-5.0.48-1.el4.centos.i386.rpm
rpm -ivh mysql-server-5.0.48-1.el4.centos.i386.rpm
if they both say

Code:
error: Failed dependencies:
and are referencing the rpm's you already have

then type
Code:
rpm -ivh --nodeps mysql-5.0.48-1.el4.centos.i386.rpm
rpm -ivh mysql-server-5.0.48-1.el4.centos.i386.rpm
 
Old 08-06-2009, 08:38 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Well yum is better solution as it will eliminate all the dependency issues. Using --nodeps option is just a workaround which should not be used unless absolutely necessary. OP has got working internet connection and should use yum to install packages rather.
 
Old 08-06-2009, 09:14 AM   #5
O.Haessler
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Rep: Reputation: 1
I would also use "yum install mysql-server". It solves the dependencies automatically, and this should work without downloading any rpm files. The option --nodeps should be used really carefully.

Regards Olli
 
Old 08-06-2009, 01:47 PM   #6
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Part of the problem MAY be that Centos only supports the most current dot release, of the 4.X release I think that is 4.7. Jumping from 4.5 to 4.7 is just a matter of yum update. Problems can arise when the .repo files have been hard coded.
 
Old 08-08-2009, 03:38 AM   #7
ngohieutp
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Original Poster
Rep: Reputation: 0
I don't know what dependencies it is needed. But i try
Quote:
rpm -ivh mysql-server-5.0.48-1.el4.centos.i386.rpm --nodeps
and it works fine. I can use
Quote:
/etc/rc.d/init.d/mysqld -start
but i don't know what i will pay for what i've done.
 
Old 08-09-2009, 06:07 AM   #8
O.Haessler
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Rep: Reputation: 1
Hi ngohieutp,

why exactly did you do that?? Thatís not a good way to install Software. The --nodeps switch should ONLY be used if you know what you are doing.

I would recommend to uninstall the Software

Quote:
rpm -e mysql-server
and after that use yum to install the Mysql Server

Quote:
yum install mysql-server-5.0.48-1.el4.centos.i386.rpm
Maybe another idea: Any reason why you are still using RHEL 4.x (CentOS 4.x)? RHEAL 5.3 is out and RHEL 5.4 is on the way.. so maybe you should update if possible.

Greetings

Olli
 
Old 08-09-2009, 06:31 AM   #9
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
While I would agree that using yum is the way to go, I do not think that Centos4.X is a bad choice. Centos4.x will be supported until Feb 2012. With RHEL/Centos 6 having been pushed back over a year(thus far) it is likely that the support life for 4.X and 5.X will be extended beyond the normal period(beyond 2012 for C4). If you do have to do a clean install and do not have a specific reason to stick with 4.X, then I would agree switching to 5.X would be a good idea.

I still suspect that the issues you are seeing with yum are that you have not update your machine to 4.7. Centos ONLY supports the most current dot release. Until you update the rest of the system to the 4.7 level you may not be able to install the mysql version you want. If you look here:

http://mirror.centos.org/centos/4.5/

and here:

http://mirror.centos.org/centos/4.6/

You will see that both of these are empty. If you have your repos hard coded to 4.5 they will not be able to work(there is nothing there for it to work with).
 
Old 08-09-2009, 10:14 PM   #10
ngohieutp
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,
As lazlow said, i can understand that i cannot use yum to install mysql in CentOS 4.5, right?
But my friend, he'd chosen some package when he installed CentOS 4.5. And he uses yum successfully.
But I installed CentOS normally, i still cannot use yum.
Ah, I installed CentOS using VMWare, and it can connect to internet.
 
Old 08-09-2009, 10:24 PM   #11
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Ok, what I am saying is that you may have to bring the entire system up to the 4.7 (current) state BEFORE you will be able to install extra packages.

Edit: Please post the results of yum repolist .

Centos4.X proper is only supporting mysql-sever4.X. The Centosplus repo has the series5 msyql.

Last edited by lazlow; 08-09-2009 at 10:39 PM.
 
Old 08-09-2009, 10:42 PM   #12
ngohieutp
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you. I don't know what you want in
Quote:
Edit: Please post the results of yum repolist .
May be it here :

1.CentOS-Base.repo
Code:
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#released updates 
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
2.yum.conf
Code:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
installonlypkgs=kernel kernel-smp kernel-devel kernel-smp-devel kernel-largesmp kernel-largesmp-devel kernel-hugemem kernel-hugemem-devel
distroverpkg=centos-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1
plugins=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
Thanks you.
 
Old 08-09-2009, 10:53 PM   #13
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Quote:
[fred@localhost ~]$ yum repolist
Loaded plugins: fastestmirror
repo id repo name status
addons CentOS-5 - Addons enabled : 0
adobe-linux-i386 Adobe Systems Incorporated enabled : 17
atrpms Red Hat Enterprise Linux 5 - x86_64 - AT enabled : 1,530
base CentOS-5 - Base enabled : 3,272
centosplus CentOS-5 - Plus enabled : 87
epel Extra Packages for Enterprise Linux 5 - enabled : 4,120
extras CentOS-5 - Extras enabled : 278
updates CentOS-5 - Updates enabled : 543
repolist: 9,847
Since your .repo file has centosplus set to enable=0 it is shut off. How does yum respond to " yum update "?
 
Old 08-09-2009, 10:58 PM   #14
ngohieutp
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Original Poster
Rep: Reputation: 0
Hi, mine is different
[CODE]
yum repolist

usage: yum [options] < update | install | info | remove | list |
clean | provides | search | check-update | groupinstall |
groupupdate | grouplist | groupinfo | groupremove |
makecache | localinstall | erase | upgrade | whatprovides |
localupdate | resolvedep | shell | deplist >

options:
-h, --help show this help message and exit
-t, --tolerant be tolerant of errors
-C run entirely from cache, don't update cache
-c [config file] config file location
-R [minutes] maximum command wait time
-d [debug level] debugging output level
-e [error level] error output level
-y answer yes for all questions
--version show Yum version and exit
--installroot=[path] set install root
--enablerepo=[repo] enable one or more repositories (wildcards allowed)
--disablerepo=[repo] disable one or more repositories (wildcards allowed)
--exclude=[package] exclude package(s) by name or glob
--obsoletes enable obsoletes processing during updates
--noplugins disable Yum plugins
[root@localhost ~]#
[CODE]
 
Old 08-09-2009, 11:14 PM   #15
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
I am running C5 so it is just a difference between the two versions of yum (nothing to worry about). As you can see from my output it just tells you which repos are known(to yum) and which ones are active. However as you posted your repo file we can see that you have the centosplus repo shut off(which has the series5 mysql). However I think that is only half of the problem. In order for this to work we have to get the base yum repo up and running on your system.

Quote:
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
Now, if you do a " cat /etc/redhat-release " I suspect it will spit out 4.5. When the above line inserts the releasever(4.5) into the address there is nothing there. What you may have to do is comment out(add a # in front of)the above line and TEMPORARILY hard code in the proper address(just until you can get through a basic yum update). Something like:

Quote:
baseurl=http://mirror.centos.org/centos/4/updates/i386/
I am probably a little off (but it should be within +- one directory) but you can see the basic idea. Once you have the system up to the 4.7 level things should get easier.

Last edited by lazlow; 08-09-2009 at 11:16 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Install MySQL 5.1 in CentOS? chillyroll Linux - Newbie 6 07-23-2010 02:16 AM
How to install kde ,apache mysql php and qt4 in centos krmkrishnan Linux - Newbie 3 07-06-2009 07:46 AM
error in installing mysql i.e. mysql-5.1.34-linux-powerpc-glibc23 in centos 4.4 i686 pankajd Linux - Newbie 1 06-07-2009 03:00 PM
cannot install mysql-server Centos 5.2 sycamorex Linux - Server 5 03-16-2009 08:12 PM
Install MySQL on CentOS 3.4 gives error Azzath Linux - Server 2 05-24-2007 12:59 PM


All times are GMT -5. The time now is 12:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration