LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Rename database (https://www.linuxquestions.org/questions/linux-newbie-8/rename-database-666350/)

myfoot 08-29-2008 03:06 PM

Rename database
 
Hello,

i need to rename mysql database in CLI mode, please guide me in this regard.


Thanks

CRC123 08-29-2008 03:16 PM

myfoot, apparently you don't like to look up things yourself. I have looked at your previous posts and your questions are always very general with no details of what you're trying to do. Also, the questions you ask show that you don't use search engines or know how to use the manual pages in Linux. So instead of giving you the answer to your question, I am going to show you how YOU can find it yourself. At least show some initiative and people would be more happy to help you. Most posts answering your questions are links to web sites found on google or references to man pages.

To use google:
go to http://www.google.com
type a search phrase in the box. for this question, a good phrase might be 'mysql database rename'
Press the 'Google Search' button. Look through results to see if they solve your problem.
If they don't solve your problem, try different search phrases.
If that still doesn't solve your problem, post here and let us know what you've tried and any info/data that may help us find and answer

To use man pages:
on Linux command line, type 'man <program>' where <program> is the name of the program you need help with.

I don't mean to sound harsh, but it bothers me when people don't at least make an effort to do something themselves.

Good Luck :)

myfoot 08-30-2008 05:43 AM

As per my knowledge its not possible in CLI mode.Thats why i asked this question from you gurus. but you really disappointed me.if my question is irritating you than dont reply me next time.


bydefault databae installed in /var/lib/mysql/data/yourdatabasename,

you can rename it.but it may corrupt your datbase.

Fantasio 08-30-2008 06:59 AM

don't think so...
1. stop mysqld
2.make a backup of /var/lib/mysql
3. mv oldname newname
4. start mysqld
5. enter mysql as dba
6. use mysql
7. update tables containing a reference to your db
8. make a test


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