Errm, needed to take the grants table updates out of the repat loop:
CREATE PROCEDURE RenameDatabase (IN oldname CHAR(64), IN newname CHAR(64))
BEGIN
DECLARE sname CHAR(64) DEFAULT NULL;
DECLARE rows INT DEFAULT 1;
DECLARE total INT DEFAULT 0;
CREATE DATABASE IF NOT EXISTS newname;
REPEAT
Shawn wrote
>I have a 2.1GB database with all InnoDB tables in it that I wanted
to
>change the name of. It took me longer to write my RENAME TABLE
>script than it did to actually move the data.
It's easier & less error-prone to do it in an sproc which prepares
& executes the rename cmds. On
Hello.
This is a frequently asked question. See:
http://lists.mysql.com/mysql/188094
For more solutions search in the archives at:
http://lists.mysql.com
Octavian Rasnita wrote:
> Hi,
>
> Is there a command for renaming a MySQL database?
>
> Thank you.
>
> Teddy
>
Robert L Cochran <[EMAIL PROTECTED]> wrote on 10/17/2005 11:00:33 AM:
> And, of course, you need to grant permissions for the new database name.
>
> Bob
>
> [EMAIL PROTECTED] wrote:
>
> >Robert L Cochran <[EMAIL PROTECTED]> wrote on 10/17/2005 07:37:26
AM:
> >
> >
> >
> >>I think you can just
And, of course, you need to grant permissions for the new database name.
Bob
[EMAIL PROTECTED] wrote:
Robert L Cochran <[EMAIL PROTECTED]> wrote on 10/17/2005 07:37:26 AM:
I think you can just rename the directory that that database lives in.
If you read the documentation for CREATE DATAB
Robert L Cochran <[EMAIL PROTECTED]> wrote on 10/17/2005 07:37:26 AM:
> I think you can just rename the directory that that database lives in.
> If you read the documentation for CREATE DATABASE in dev.mysql.com,
> you'll see they discuss renaming the directory (although it does not
> directly
I think you can just rename the directory that that database lives in.
If you read the documentation for CREATE DATABASE in dev.mysql.com,
you'll see they discuss renaming the directory (although it does not
directly say this can be done to rename the database, but it comes
really close to that
C.R. Vegelin wrote:
What about renaming the folder indicating the database name.
I work with Windows XP and renaming a folder works well.
Cor,
Have you tried it with InnoDB tables or anything other than MyISAM
tables? InnoDB uses a single tablespace per server (unless specified
that it shoul
onday, October 17, 2005 12:11 PM
Subject: Re: renaming the database
Octavian Rasnita wrote:
Is there a command for renaming a MySQL database?
Sorry, there is no command for that. For small databases you can use
administration tools like phpMyAdmin, etc. which will do it for you by
duplicating
vian Rasnita" <[EMAIL PROTECTED]>
Cc:
Sent: Monday, October 17, 2005 12:11 PM
Subject: Re: renaming the database
> Octavian Rasnita wrote:
> > Is there a command for renaming a MySQL database?
>
> Sorry, there is no command for that. For small databases you can use
>
Octavian Rasnita wrote:
Is there a command for renaming a MySQL database?
Sorry, there is no command for that. For small databases you can use
administration tools like phpMyAdmin, etc. which will do it for you by
duplicating the database structure and data, and then drop the 'old'
database.
11 matches
Mail list logo