LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-30-2011, 02:23 AM   #1
anurag2202
LQ Newbie
 
Registered: Aug 2010
Posts: 20

Rep: Reputation: 0
Mysql installation on CentOS


Hii

I installed CentOS on an IBM server. Now, i need to install Mysql 5.5 64-bit via RPM. By default, mysql installation path is /var/lib/mysql. But i want to change the path of database storage. I tried --prefix option too but still not done.

Please suggest how can i change the database path because through rpm installation my.cnf file is not created.

Thanks
 
Old 11-30-2011, 02:28 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
If my.cnf is not created, you should be able to create it yourself. I guess you are interested in setting the variable "datadir".

HTH,

Evo2.
 
1 members found this post helpful.
Old 11-30-2011, 03:11 AM   #3
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 32
The default for RPM installation is /var/lib/mysql. If you want to have it stored on a different directory, try installing from source.
 
0 members found this post helpful.
Old 12-02-2011, 08:48 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by tajamari View Post
The default for RPM installation is /var/lib/mysql. If you want to have it stored on a different directory, try installing from source.
Sorry, but you're very wrong. Moving a database location is as easy as modifying the datadir variable (as evo2 said), in the my.cnf file. From there you either copy/move your current database files to the new location, or start the database for the first time and things come up.

OP, a my.cnf file will be installed if you install the mysql-server, and it's usually in /etc. Note that the file will be installed if mysql SERVER is installed...it's quite possible to install lots of mysql packages (for perl, development headers, clients, etc), and NOT install mysql-server. If you really don't have one, you can find sample my.cnf files through Google, and copy one over, changing the datadir variable as needed.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Server Linux, CentOS VPS - Lost connection to MySQL server during query snooze1 Linux - Newbie 3 10-29-2011 03:01 AM
error in installing mysql i.e. mysql-5.1.34-linux-powerpc-glibc23 in centos 4.4 i686 pankajd Linux - Newbie 1 06-07-2009 02:00 PM
mysql-installation: Not enough space in /var/lib/mysql/ linus123 Linux - Software 8 11-10-2006 02:19 PM
MySQL 3.23.58-14 installation prolem - mysql.sock not found lightcom Linux - Software 4 02-23-2005 12:46 AM
php4 mysql, installation, php-pages with mysql info stay empty dnla Linux - Software 2 03-14-2004 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration