LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-09-2004, 07:16 AM   #1
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Rename mysql database


Hi all!

I've got a mysql database that has to be renamed. So right now it is called 'example' and i want to rename it to 'examp'.
How can i rename the database???
 
Old 06-09-2004, 07:42 AM   #2
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
I think you could rename it directly from the source. In Mandrake, the databases we create with mysql are stored at /var/lib/mysql, so you database should be at "/var/lib/mysql/example", simply move it :

Code:
mv /var/lib/mysql/example /var/lib/mysql/examp
Regards!

Last edited by Mega Man X; 06-09-2004 at 07:44 AM.
 
Old 06-09-2004, 08:38 AM   #3
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
and afther i've renamed it that way i can just change the users and db table to set everything oke?
 
Old 06-09-2004, 09:31 AM   #4
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
hmmmm, I guess so. though, if you are going to add/remove tables, then it's better to do the sql way. Rename the database as I described above, then run mysql:

Code:
mysql> use examp
to change into your database. The rest is pure sql as usual. I'd also recommend Webmin to administrate your database
 
Old 06-11-2004, 05:54 AM   #5
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
I have a couple of databases, but how do i lock that specific database? Or dont i need to lock it?
(the database is about 5Mb)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 02:43 PM
MYSQL help - mysql database missing eloviyandhi Linux - Software 1 03-20-2004 09:20 PM
mysql database creation zuessh Linux - Software 17 05-14-2003 01:13 PM
Mysql database from cd JHuizingh Linux - Software 0 02-22-2003 02:08 PM
mysql database huno Linux - General 8 02-11-2003 08:15 PM


All times are GMT -5. The time now is 11:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration