niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » MySQL » misc
move databases
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
dignix
*nix forums beginner


Joined: 07 Mar 2005
Posts: 1

PostPosted: Tue Mar 08, 2005 6:08 pm    Post subject: move databases Reply with quote

I need to move mysql databases to a different partition. Can anyone tell me what I could do to move all the databases to /mnt/hda7.
Back to top
mihai
*nix forums addict


Joined: 27 Jan 2005
Posts: 71

PostPosted: Wed Mar 09, 2005 11:04 am    Post subject: Reply with quote

first stop your mysql server, then just move all the files in /var/lib/mysql ( or whatever the default datadir is on your system ) to /mnt/hda7
Code:

mv /var/lib/mysql /mnt/hda7
chown -R mysql:mysql /mnt/hda7/mysql

the chown is to make sure the new dir is owned by mysql.
Next you have to edit my.cnf and under the [mysqld] section you will have to add
datadir=/mnt/hda7/mysql
and start mysqld
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Tue Dec 02, 2008 1:04 pm | All times are GMT
navigation Forum index » Databases » MySQL » misc
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Move Oracle 10g database to another location Selt Server 0 Fri Jul 21, 2006 2:14 pm
No new posts database Share Memory Limit (2 GB ) in a Instance is tota... sadanjan@gmail.com IBM DB2 0 Fri Jul 21, 2006 12:57 pm
No new posts howto log in from one bsd-server to another and move file... Tobias Steer FreeBSD 3 Thu Jul 20, 2006 10:02 am
No new posts Linking Tables from 2 databases Pratik Shukla PostgreSQL 2 Wed Jul 19, 2006 5:54 pm
No new posts What happend if i "move" a message body and header from t... Alberto Garcia Exim 1 Fri Jul 14, 2006 5:12 pm

Project cars for sale | Loans | Loan | Mortgage Calculator | RC Boats
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1467s ][ Queries: 16 (0.0758s) ][ GZIP on - Debug on ]