LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to install mysql on CentOS (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-mysql-on-centos-745528/)

ngohieutp 08-06-2009 05:15 AM

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 :cry: :cry: :cry: ????

linuxlover.chaitanya 08-06-2009 06:08 AM

Just use yum install mysql-server.

dxangel 08-06-2009 07:05 AM

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


linuxlover.chaitanya 08-06-2009 07:38 AM

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.

O.Haessler 08-06-2009 08:14 AM

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

lazlow 08-06-2009 12:47 PM

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.

ngohieutp 08-08-2009 02:38 AM

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.

O.Haessler 08-09-2009 05:07 AM

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

lazlow 08-09-2009 05:31 AM

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).

ngohieutp 08-09-2009 09:14 PM

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.

lazlow 08-09-2009 09:24 PM

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.

ngohieutp 08-09-2009 09:42 PM

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.

lazlow 08-09-2009 09:53 PM

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 "?

ngohieutp 08-09-2009 09:58 PM

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]

lazlow 08-09-2009 10:14 PM

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.


All times are GMT -5. The time now is 12:05 PM.