Best way to install MySQL 5.6 on Centos 6.4 - mysql

I just installed Centos 6.4, and installed MySQL using the version that came with the Centos distribution. To my dismay, it is MySQL 5.1.69 versus the current 5.6.12. As stated on http://dev.mysql.com/doc/refman/5.5/en/linux-installation-native.html, "the MySQL version will often be some way behind the currently available release", but I didn't expect that long.
[root#centosBox ~]# rpm -qa | grep mysql
mysql-5.1.69-1.el6_4.x86_64
mysql-devel-5.1.69-1.el6_4.x86_64
mysql-server-5.1.69-1.el6_4.x86_64
mysql-libs-5.1.69-1.el6_4.x86_64
[root#centosBox ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
[root#centosBox ~]#
An alternative is to install by RPM packages which is the "recommended way to install MySQL" per http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html. I have done so and it wasn't overly complicated, however, I am concerned as I've often been told that I should always install by yum when available. Towards the very end of the documentation, it does describe doing so extremely briefly using yum, however, it is so brief that I question whether it is the way to go.
So.... What is the best way for a not guru Linux user to install/upgrade MySQL on a Centos machine?

Just this week (2013-10-28), MySQL announced official yum repositories for MySQL Community Edition. The packages are intended for use with RHEL-compatible Linux (e.g. CentOS).
All the details including how to set up the yum repo on your system, can be found from the announcement:
http://insidemysql.com/announcing-new-yum-repositories-for-mysql/

A bit off-topic but there we go.
It is recommended to install from the repositories because you can later update your software to a newer version with a simple yum upgrade. The repository takes care of that for you, as well as any dependencies the software may entertain with other libraries.
RPM Packages installed manually (even with yum, which then only acts as an installer) will have to be managed manually as well.
Since the MySQL RPM package shows no dependencies (as far as I can tell from the manual), you are safe from this side.
And to answer your question: the best method is to stick with the versions from the repository. If you need a newer version, then you took the right path.

I am no guru myself but I was happy with the result of the RPM method you mentioned since other times I have seen problems with mysql-libs being a dependency for other packages.
(depending on the 5.6 version you want and cpu)
mkdir MySQL
cd MySQL
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
tar -xvf MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
yum install MySQL*rpm
installs them in the correct order and removes mysql-libs in one step without conflicts.
http://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html

It doesn't surprise me that MySQL is a bit behind. Why would Oracle make it easy for you to not use pay-for Oracle? </rant>
Anyway, you can get the awkwardly named, but otherwise identical MariaDB to run easily by adding a new YUM repository.

You can install MySQL 5.5 (mysql55-server.x86_64) from IUS repository (currently version 5.5.34 available)

Related

Installing MySQL and MySQLWorkbench In Offline Red Hat 7 Machine

I am trying to install mysql workbench on a system without network. I downloaded the mysql-workbench-community, mysql-community-{server, client, common, libs} which were noted in the "Installing RPM Packages" section of MySQL Install Manual. It states that these are the standard rpm packages needed for a basic functional install of mysql community. So with that I downloaded all the rpm packages and attempted to manually install each using:
sudo rpm -ivh mysql-community-package-name.rpm
Unfortunately I keep getting dependency errors. I found this link to obtain all the dependencies for a package. So on my second attempt I ran the following:
Repoquery -R --resolve --recursive mysql-community-server | xargs -r yumdownloader
Which gave me about 100 rpm packages. I transferred them onto my machine and unfortunately more dependencies like mysql-connectors-community and mysql-=tools-community came up which were never documented or mentioned as dependencies with the script.
What am i doing wrong? Is there a way to download all the rpms and bundle them together as a custom RPM in the future? I see ubuntu has a apt-offline command mentioned here. Is there a similar method I can apply for redhat?
Update1:
I have an idea to create a container rhel7 instance, mounting /root/tmpkg and running this example. But is there another way I should consider?

Debian install MySQL specific version not available

I got two serveurs. ClientServ and DevServ. The client serveur is on Debian 7 with Mysql 5.5.49-0+deb7u1. My goal is to have the same package in my DevServ.
Unfortunaly, I tried to apt-get install I only got "5.5.55-0+deb7u1". I checked the repo actually there isn't any 5.5.49 package in wheezy...
I tried everything.
Using mysql's .deb, it gives only mysql with the correct version but not the other composents (mysql-server etc).
I saw that in Jessie repo there is a "mysql-server-5.5 5.5.49-0+deb8u1"
Is it possible to use it ?
Please help me... :)
Thank you very much in advance,
Good day
There should be no issues simply downloading all the *.deb packages and installing them for the relevant version of the mysql server. Note that you'd also need to grab the *.deb files for any mysql modules you need at the same time.
Then you just install them directly with dpkg, after first having purged all the installed mysql packages ( apt-get remove --purge mysql* ). Personally however I would not do this, I have never found any significant issue using varying mysql server versions between live and dev machines, and particularly if both are the same version, 5.5, I don't see why you'd experience any significant issues, but if it's actually and critically mandatory to run precisely the same versions, then directly installing the deb files should work fine.
Just make sure to download them and store all the mysql files you'd ever potentially need in a directory somewhere so you have them to install in case the versions you needed go away, or in case you realized you'd forgotten a module or something.
If this is only a dev system, I think personally I'd just install the debs directly to avoid versions changing.
But unless you are absolutely certain some key difference exists between those two debian versions, which probably is not the case, it's probably just some security update or something that has no impact on how mysql server processes sql, I'd just use what is in jesse, and not worry about it.
Sample:
http://mirrors.kernel.org/debian/pool/main/m/mysql-5.5/
There you see versions 47 and 55, for example, of the server, and you'd also grab the 'core' package as well to match. Tnen you'd look for any other modules you might need here:
http://mirrors.kernel.org/debian/pool/main/
keeping in mind that with dpkg, you have to install the dependency first, then the next package, or both together in some cases. However, what I would do first, not last, in your case, is to make sure there actually is a functional difference between the different 5.5 versions before dealing with the potential headaches involved in trying to maintain a server using dpkg deb package installs.
Here's, for example, a list of mysql packages you might need. Note that I just grabbed this off a dev box, this is not intended to be an authoritative list, just an example, but it does show that mysql is used in many different places on a system, and you might run into issues trying to downgrade manually, which is why I'd in general avoid trying this method (for illustration purposes I changed 5.6 to 5.5). The key is to take the absolute minimum package list to download manually the deb files for.
dpkg -l | grep mysql | awk '{print $2}'
libaprutil1-dbd-mysql:i386
libdbd-mysql-perl
libmysqlclient15off
libmysqlclient16
libmysqlclient18:i386
libqt4-sql-mysql:i386
libqt5sql5-mysql:i386
mysql-client-5.5
mysql-client-core-5.5
mysql-common
mysql-server-5.5
mysql-server-core-5.5
php5-mysql
You'd just take the existing mysql install that is working and run that command to see the packages you need to download. As you can see, it's a pain, which is why I'd generally avoid trying to do a development install in this way, I've never hit any sql issues, or return issues using vastly differing mysql versions, so unless your sql queries are using things only found in the specific version, which is very unlikely, you are unlikely to gain much. But this is how you do it in case future searchers land here.
Note that most dev boxes are probably running desktops, and have more mysql dependencies than just the mysql server stuff for web development, and that can lead to issues.

Error with MySQL Instalattion in Centos 6.4

I'm trying to install MySQL in my CentOS 6.4 (X86_64) with the command:
"yum install mysql mysql-server"
And I'm having problems with the installation, the error presented is the following:
Check the error log in the following link http://pastie.org/10022423
Any Idea why this error ? thanks for you helps!
The problem is you already have a version of some MySQL packages installed that are from a different distribution/vendor than CentOS.
Since different people created the packages using different names and standards, yum does not know how to fix this situation.
You have libmysqlclient16-5.1.69-1.w6.x86_64 installed already providing the client libraries, but the CentOS package is mysql-libs. This package appears to be provided by "webtatic":
https://webtatic.com/packages/mysql55/
http://rpm.pbone.net/index.php3/stat/4/idpl/21966562/dir//com/libmysqlclient16-5.1.69-1.w6.x86_64.rpm.html
Likely you need to consider removing the libmysqlclient package and installing mysql-libs in it's place. That will probably remove some items because of dependencies, you might be able to get away with manually removing it with the rpm --nodeps -e, but it may also be the packages cannot have their dependency satisfied by mysql-libs so slightly risk move if you don't fully check everything first. This often works, though.
As an alternative looks like you can install the mysql server package from webtatic as well, based on their instructions here, that might be a less complex alternative if you are happy to continue relying on their repository:
https://webtatic.com/packages/mysql55/
As far that I know, that error will shows up when you attempt to install packages that already have been installed before. So, you probably should reinstall your mysql.
Source : https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-rpm-conflicting-files.html

What is a yum package conflict?

When running the transaction check to install mysql i'm getting:
Processing Conflict: mysql55-5.5.29-1.w6.x86_64 conflicts mysql < 5.5
I guess this means i'm attempting to install a package called mysql55-5.5.29-1.w6.x86_64 on to a system with mysql already installed but somehow there is a conflict?
yum says that mysql isn't installed so it was installed without using the repositories. In that case how does yum know there is confict?
it would be good to better under what 'confict' means.
There are many online yum repo available and all are free opensource contribute. So source packages are compiled with different options in each repo. So when we add 2 or more yum repo at a time, it may happen that 2 or more packages are of same version are selected and we get a conflict error.
In your case you added some repo which is providing mysql 5.5 which is already available with some other name in some other repo or already installed but new mysql package is selected by yum for any other package as dependency. Try removing one of the repo or try installing it as yum install mysql-5.5*
You can try this : yum list | grep mysql. It will list mysql in different packages, then you can make a decision to remove one of them and install mysql again.

Can we install MySQL different versions on Linux CentOS5.8?

I am trying to install a software which required MySQL-server, MySQL-client installed on the server so now I want to install MySQL-server and MySQL-client using rpm files "MySQL-server-5.5.17-1.rhel5.x86_64.rpm" and "MySQL-client-5.5.17-1.rhel5.x86_64.rpm".
I have installed MySQL-client but when I try to run mysql-server
*rpm -i MySQL-server-5.5.17-1.rhel5.x86_64.rpm*
it's showing error:
*error: Failed dependencies:
MySQL conflict with mysql-5.0.77-4.el5_6.6.x86_64
MySQL conflict with mysql-5.0.77-4.el5_6.6.i386
MySQL conflict with mysql-server-5.0.77-4.el5_6.6.x86_64*
So how can i solve this problem?
the error given by you *error: Failed dependencies:
MySQL conflict with mysql-5.0.77-4.el5_6.6.x86_64
MySQL conflict with mysql-5.0.77-4.el5_6.6.i386
MySQL conflict with mysql-server-5.0.77-4.el5_6.6.x86_64*
It clear show that the machine you are going to install mysql 5.5 rpm have mysql 5.0.77 installed .
to resolve this problem .
1. you take backup of datadir and my.cnf (if you are using mysql 5.0 db server earlier).
2. remove all mysql 5.0 server packages , to remove these package you should knew what are the packages already installed on machine
to view all mysql package already installed use rpm -qa | grep -i "mysql*" this command show what package is already installed on machine
now you have to remove all package which name shows in above command.
to remove a package/rpm use rpm -e mysql-5.0.** if show error then use
rpm -e --nodeps mysql-5.0.**
we have to remove all packages one by one by using rpm -e .
after successful remove all older version of mysql , now start installation of mysql-5.5*** packages by using rpm -ivh mysql-5.5***.rpm.
First question - is the version of MySQL already installed actually in use or was it simply there as a result of a fresh CentOS install? If the former, try upgrading rather than installing. If the latter, uninstall the old version (possibly using the --no-deps option on rpm) and then install the newer version
Next, are you trying to replace MySQL or install another version alongside it?
If the former, again try upgrading rather than installing. If that's not possible, you're going to have to remove the older version and then install the new version
If the latter, and if it is possible, look at the --prefix and --relocate options in RPM.as they may help.
If you do to mange to get it installed side by side with an older, you'll have fun and games ensuring that the relevant versions are pointing to the correct libraries and that you don't get any corruption between them. Also, you will need to run them so that they listen on separate ports with separate database folders, PID and socket files etc.
Whatever you need to do, do it out of business hours with as many backups as you can do