MySQL: Error: Package mysql-server-community is not relocatable Solution

Source: Internet
Author: User

From: http://www.thegeekstuff.com/2008/07/howto-install-mysql-on-linux/

 

Howto install MySQL on Linux
By Ramesh natarajan on July 6, 2008 sharethis

 

Most of the Linux distro comes with MySQL. if you want use MySQL, my recommendation is that you download the latest version of MySQL and install it yourself. later you can upgrade it to the latest version when it becomes available. in this article, I will explain how to install the latest free community edition of MySQL on Linux platform.

1. download the latest stable relase of MySQL

Download MySQL from mysql.com. please download the Community edition of MySQL for your appropriate Linux platform. I downloaded the "Red Hat Enterprise Linux 5 rpm (x86 )". make sure to download MySQL server, client and "headers and libraries" from the download page.

MySQL-client-community-5.1.25-0.rhel5.i386.rpm
MySQL-server-community-5.1.25-0.rhel5.i386.rpm
MySQL-devel-community-5.1.25-0.rhel5.i386.rpm
2. Remove the existing default MySQL that came with the Linux distro

Do not perform this on an system where the MySQL database is getting used by some application.

 

 
[Local-host] # rpm-Qa | grep-I mysqlmysql-5.0.22-2.1.0.1mysqlclient10-3.23.58-4.RHEL4.1 [local-host] # rpm-e MySQL -- nodepswarning:/etc/My. CNF saved as/etc/My. CNF. rpmsave [local-host] # rpm-e mysqlclient10

3. Install the downloaded MySQL package

Install the MySQL server and client packages as shown below.

 
[Local-host] # rpm-IVH MySQL-server-community-5.1.25-0.rhel5.i386.rpm MySQL-client-community-5.1.25-0.rhel5.i386.rpmPreparing... ######################################## ### [100%] 1: mysql-client-Community ################################### ####### [50%] 2: mysql-server-Community ################################### ####### [1, 100%]

This will also display the following output and start the MySQL daemon automatically.

Please remember to set a password for the MySQL Root User! Root Password 'new-password'/usr/bin/mysqladmin-u root-H medica2 password' New-password' alternatively you can run: /usr/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. this isstronugly recommended for production servers. see the manual for more instructions. please report any problems with the/usr/bin/mysqlbug SCR IPT! The latest information about MySQL is available at http://www.mysql.com/Support MySQL by buying support/licenses from http://shop.mysql.com/Starting mysql. [OK] Giving mysqld 2 seconds to start

Install the "header and libraries" that are part of the mysql-devel packages.

 

[Local-host] # rpm-IVH MySQL-devel-community-5.1.25-0.rhel5.i386.rpmPreparing... ######################################## ### [100%] 1: mysql-devel-Community ################################### ####### [1, 100%]

Note: When I was compiling PHP with MySQL option from source on the Linux system, it failed with the following error. installing the mysql-devel-Community package fixed this problem in installing PHP from source.

 
Configure: Error: cannot find MySQL header files under yes. Note that the mysql client library is not bundled anymore!

4. perform post-install security activities on MySQL.

At a bare minimum you shoshould set a password for the root user as shown below:

 
[Local-user] #/usr/bin/mysqladmin-u Root Password 'my2secure $ password'

The best option is to run the mysql_secure_installation script that will take care of all the typical security related items on the MySQL as shown below. On a high level this does the following items:

    • Change the root password
    • Remove the anonymous user
    • Disallow root login from remote machines
    • Remove the default Sample Test Database

 

Note: running all parts of this script is recommended for all mysqlservers in production use! Please read each step carefully! In order to log into MySQL to secure it, we'll need the currentpassword for the root user. if you 've just installed MySQL, andyou haven' t set the root password yet, the password will be blank, so you shoshould just press enter here. enter current password for root (enter for none): OK, successfully used password, moving on... setting the root password ensures that nobody can log into the mysqlroot user wi Thout the proper authorisation. You already have a root password set, so you can safely answer 'n'. Change the root password? [Y/n] ynew password: re-enter new password: Password updated successfully! Reloading privilege tables... success! By default, a MySQL installation has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. this is intended only for testing, and to make the installationgo a bit smoother. you shoshould remove them before moving into AProduction environment. remove anonymous users? [Y/n] y... success! Normally, root shoshould only be allowed to connect from 'localhost'. thisensures that someone cannot guess at the root password from the network. disallow root login remotely? [Y/n] y... success! By default, MySQL comes with a database named 'test' that anyone canaccess. this is also intended only for testing, and shocould be removedbefore moving into a production environment. remove test database and access to it? [Y/n] Y-dropping test database... success! -Removing privileges on Test Database ...... success! Reloading the privilege tables will ensure that all changes made so farwill take effect immediately. Reload privilege tables now? [Y/n] y... success! Cleaning up... all done! If you 've completed all of the above steps, your mysqlinstallation shoshould now be secure. Thanks for using MySQL!

5. Verify the MySQL installation:

You can check the MySQL installed version by Deming mysql-V as shown below:

 
[Local-host] # mysql-vmysql ver 14.14 distrib 5.1.25-RC, for Redhat-Linux-GNU (i686) using Readline 5.1

Connect to the MySQL database using the root user and make sure the connection is successfull.

 
[Local-host] # mysql-u root-penter password: Welcome to the MySQL monitor. commands end with; or \ G. your MySQL connection ID is 13 server version: 5.1.25-RC-Community MySQL Community Server (GPL) type 'help; 'or' \ H' for help. type '\ C' to clear the buffer. mysql>

Follows the steps below to stop and start MySQL

 [local-host] # service MySQL statusmysql running (12588) [OK] [local-host] # service MySQL stopshutting down MySQL. [OK] [local-host] # service MySQL startstarting MySQL. [OK] 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.