Maybe this is common knowledge by now, but I’ve seen this problem popping up at work and I’ve run into it today. I upgraded Fedora 4 to 5 and wanted to get MySQL 5.1.11 on it instead of the MySQL 5.0 delivered with Fedora 5. This also goes mostly for Red Hat EL btw..
These were the things I had to do, on a system without any production databases. Do not do this on production without backups and lots of coffee!
- Download the generic RPMs from http://dev.mysql.com/downloads/: Server, Client, libraries and headers and the shared libraries. Put them all in one directory.
- run in that directory: rpm -Uvh MySQL*
- If point 2 didn’t give errors, you going to have problems starting MySQL.
- mysql system user is missing. To recreate it:
# adduser -d /var/lib/mysql -s /bin/bash -r -M -l mysql
- I didn’t keep the uid/gid, so I had to make sure permissions were set OK on the existing datadir:
# chown -R mysql:mysql /var/lib/mysql
- Next, remove the –basedir option from the my.cnf under [mysql.server]
As a general tip: keep an eye on the error log, /var/log/mysqld.log
That’s it basicly. Run mysql_upgrade if you like, I just removed the mysql/ and grant tables and recreated them new with mysql_install_db. I was removing Plesk which basically messes up your Linux distro.
Hope this helps someone!