How do you Install MySQL from the Command Line?

bobross419

Golden Member
Oct 25, 2007
1,981
1
0
I'm doing all of this as part of studying for the Linux+ exam, so I'm pretty firm on using RPM for this. I have found a few examples using apt-get and yum, but I want to do this with RPM. I have been able to install other applications with RPM in the past, but I just can't seem to get this one working. Any help is appreciated and any additional information that is required just ask and I'll post it ASAP.

O/S: CentOS 5.5
SQL Version: 5.1.48
Package Manager: RPM 4.4.2.3

Resources I've tried:

I've been using rpm -Uvh, but I get the same error messages with rpm -ivh.

I try the following:

Code:
rpm -Uvh MySQL-server-community-5.1.48-1.rhel5.i386.rpm
And I get the following error:

Code:
error: open of MySQL-server-community-5.1.48-1.rhel5.i386.rpm failed: No such file or directory
So then I decided I'd try a direct FTP or HTTP download; unfortunately, the Download Page points to a bunch of mirrors in the following format:

Code:
http://www.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.48-1.rhel5.i386.rpm/from/[B]http://mirror.services.wisc.edu/mysql/[/B]
     -- or --
http://www.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.48-1.rhel5.i386.rpm/from/[B]ftp://mirror.services.wisc.edu/mirrors/mysql/[/B]
If I try a direct download using the following:
Code:
rpm -Uvh http://www.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.48-1.rhel5.i386.rpm/from/[b]ftp://mirror.services.wisc.edu/mirrors/mysql/
I receive an error "File not found by glob: filename" -- The same holds true for the HTTP redirect.

Trying to manually navigate through the HTTP (e.g. http://mirror.services.wisc.edu/mysql/ ) just brings me back around to the main download page. If I go through the FTP (e.g. ftp://mirror.services.wisc.edu/mirrors/mysql/ ) I am able to locate the correct download file:

Code:
ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.1/MySQL-client-community-5.1.48-1.rhel5.i386.rpm
But when I try to RPM the file:
Code:
rpm -Uvh ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.1/MySQL-client-community-5.1.48-1.rhel5.i386.rpm
I get this error:
Code:
Retrieving ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.1/MySQL-client-community-5.1.48-1.rhel5.i386.rpm
error: skipping ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.1/MySQL-client-community-5.1.48-1.rhel5.i386.rpm - transfer failed - Unknown or unexpected error
I try going directly into the site with this command:
Code:
ftp mirror.services.wisc.edu
But I don't have the login credentials necessary.

The second resource that I have listed above directs me to ftp.mysql.com, but this only contains older versions of MySQL in source format.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
bobross419 said:
error: open of MySQL-server-community-5.1.48-1.rhel5.i386.rpm failed: No such file or directory

That sounds like a simple typo of the filename or you're running RPM from a different directory than that with the rpm in it.

always compile source man learn the force.

God no, compiling from source should be a very, very last resort.
 

JD50

Lifer
Sep 4, 2005
11,690
2,148
126
'yum localinstall' will work on a local rpm file and it will resolve any dependencies from any yum repos that you have. yum is incredibly powerful and they're adding more to it as we speak. There's now a 'yum history' command that is very useful. IIRC Linux+ is a multiple choice kind of exam? I personally hate those kinds of exams, especially for Linux, I think you'd be better off studying for and taking the RHCT exam then moving up to RHCE. One, IMO, it holds much more weight than Linux+ (or any multiple choice exam) and Two, it's a functional exam so as long as you accomplish what you need to get done then you pass, it doesn't matter what tools you use. That's much more in the spirit of Linux and OSS than a multiple choice exam where there's only one correct way to do it. Sorry for the rant, good luck with your cert.

Also make sure you're using tab completion because as nothinman said it sounds like a simple typo.
 

bobross419

Golden Member
Oct 25, 2007
1,981
1
0
Shouldn't be a typo, since I'm copying and pasting directly from the address bar.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
You can't install from an RPM if you don't have the file locally on your machine...
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Good point, Crusty, RPM works on files directly so you need to have access to the file either locally or via HTTP/FTP. If you don't have anonymous access to download the file or haven't downloaded the file manually yourself, RPM won't be able to do anything for you.
 

bobross419

Golden Member
Oct 25, 2007
1,981
1
0
On my Windows machine, I can browse through and download the file just fine. I run into problems when attempting to install using RPM with the HTTP or FTP links directly.
 

JD50

Lifer
Sep 4, 2005
11,690
2,148
126
Just download the rpm and install it locally. I just navigated the mysql.com site, found the mirror that you're talking about and downloaded the rpm. I don't currently have a linux box with internet access handy so I can't test your link, but typically an rpm install would work fine if you provide the link just like you did... "rpm -Uvh http://some.host.com/somerpm.i386.rpm"

It probably has something to do with the way they redirect you to the rpm and don't give you a direct link to the actual rpm.
 

bobross419

Golden Member
Oct 25, 2007
1,981
1
0
It probably has something to do with the way they redirect you to the rpm and don't give you a direct link to the actual rpm.

This is exactly what I'm thinking, which is why I had gone through the mirror itself removing the first part of the URL, but it still isn't working for me.

This is as much of a learning process for me as an actual desire to get MySQL installed... I can easily grab the file from my Windows machine at this point, but I'd still like to see if I can get it straight from the site from the command line.

Thanks for the help so far guys.

@JD50 - Linux+ is just a first step for me. I haven't done any certs before and wanted to get my feet wet. I'm planning on going for the more advanced and practical certs after I'm done with this, but I want to start small (Exam costs are also a factor for me right now) and work my way up. Thanks for the advice though
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
This is as much of a learning process for me as an actual desire to get MySQL installed... I can easily grab the file from my Windows machine at this point, but I'd still like to see if I can get it straight from the site from the command line.

I really wouldn't worry about that, it's not something you'll be doing often. 99% of the time if you're using rpm directly you'll be using a local file that you already downloaded. And even then you should probably use 'yum localinstall' so that you don't have to deal with the dependencies manually.
 

bobross419

Golden Member
Oct 25, 2007
1,981
1
0
Well, I went ahead and just installed it using yum. I'm still going through the install process and I'm not running into any problems so far.

I think it was the paths for the downloads that was causing problems. I know how to do an RPM install already, so I figure it is more important to get MySQL installed so I can do some PERL database scripting for an upcoming job opening at my company

Thanks for the help with the RPM thing anyways, and thanks for telling me to just yum it.
 

ethebubbeth

Golden Member
May 2, 2003
1,740
5
91
If your goal was to install the RPM from the command line without using Yum, couldn't you just use wget to download the file and then use the rpm command to install it?

Just my .02
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
If your goal was to install the RPM from the command line without using Yum, couldn't you just use wget to download the file and then use the rpm command to install it?

Just my .02

Yes, but you'd also have to repeat that same process for every one of its dependencies. There is rarely any reason to bother with that. Let yum do it.
 

Emulex

Diamond Member
Jan 28, 2001
9,759
1
71
That sounds like a simple typo of the filename or you're running RPM from a different directory than that with the rpm in it.



God no, compiling from source should be a very, very last resort.

@#$@#? no way man. binaries have the wrong settings for your usage.

the only reason i don't nag on SQLOS for not compiling is that it has endless amounts of self and auto-tuning (working directly with Windows) to handle its business.

if you can't compile mysql from source you should never be allowed to have root.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
@#$@#? no way man. binaries have the wrong settings for your usage.

the only reason i don't nag on SQLOS for not compiling is that it has endless amounts of self and auto-tuning (working directly with Windows) to handle its business.

if you can't compile mysql from source you should never be allowed to have root.

Maybe if it was still 1998...
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
@#$@#? no way man. binaries have the wrong settings for your usage.

Settings? If it has to be changed at compile time, that's not really a setting... if it were such a useful thing to change, it would probably be changeable at runtime.

Can you give some concrete of examples of compile-time settings one would want to change for MySQL?
 

Emulex

Diamond Member
Jan 28, 2001
9,759
1
71
custom functions UDF - optimizing for specific processors (arm/sparc/yadda) - non static linking of libs. maybe i'm just old school.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
custom functions UDF
You can use shared objects for that.

optimizing for specific processors (arm/sparc/yadda)
Okay, but that's a small niche. I would never say that no one should compile anything. The share of MySQL users who are 1) running on an obscure architecture, 2) need to squeeze out every last drop of performance, and 3) are willing to do the benchmarking needed to test the effects of the compiler options they are considering (because the effects are generally not very predictable) -- is a tiny number of people and is basically irrelevant to an argument about whether or not compiling software yourself is worthwhile in the general case.

non static linking of libs.
That's already the norm...
 

Emulex

Diamond Member
Jan 28, 2001
9,759
1
71
Ahh well i guess times have changes. us old farts who like to audit/test our code will compile. it's not like it takes any time on a decent dual nehalem system to do it. by the time you get your coffee it's done. i do understand back in the days when systems were slow mysql was a ah heck.

But i feel like PERL that is 100% operating to my needs. I would not deploy into commercial use a non-source-compiled version. it has no benefit should i see fit to make core changes. then i'd have to get a source version compile it and deploy it and overwrite (lol) the old libs/etc and pray anything compiled against them are going to work.

it is a vicious habit but truthfully when you are just a user of the app; that is one thing; the benefit of FOSS on *nix is the ability to customize the heck out of everything to get the mission accomplished. Not having source to any piece of the puzzle; well i might as well just use a microsoft product.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Emulex said:
Ahh well i guess times have changes. us old farts who like to audit/test our code will compile. it's not like it takes any time on a decent dual nehalem system to do it. by the time you get your coffee it's done. i do understand back in the days when systems were slow mysql was a ah heck.

The problem isn't compile time, it's maintenance. Having to compile MySQL and all of it's dependencies by hand on every server is just a waste of time. I can probably update a half-dozen or so servers via apt or yum in the same amount of time you can do one. And I'll be able to trust my results more than yours.

Emulex said:
But i feel like PERL that is 100% operating to my needs. I would not deploy into commercial use a non-source-compiled version. it has no benefit should i see fit to make core changes. then i'd have to get a source version compile it and deploy it and overwrite (lol) the old libs/etc and pray anything compiled against them are going to work.

"Should you see fit"? You don't even know why you'd want to compile it yet other than you might want to compile it in the future? And what core changes would you really even think about making to either perl or MySQL? Frankly, I wouldn't let you near any systems that I'm responsible for after hearing that.

Emulex said:
it is a vicious habit but truthfully when you are just a user of the app; that is one thing; the benefit of FOSS on *nix is the ability to customize the heck out of everything to get the mission accomplished. Not having source to any piece of the puzzle; well i might as well just use a microsoft product.

You still have the source available and it's still very useful for debugging. But making and maintaining local changes is precarious at best and not something any sane person would want to do except in extreme circumstances. Compiling things from source these days is virtually pointless and just puts more work back on you.

Sounds to me like it's a smoking habit. If you ask people why they still smoke most will tell you that it's simply because they can't stop.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |