Question

I have installed redmine in my ubuntu 12.04 system with mysql server database. Currently the datas are being stored in a default database named mysql. I want to create a new database in the same mysql server and change the location of data storage to the new database. How can I achieve that?

Was it helpful?

Solution

In MySQL, you can do

RENAME DATABASE mysql TO newDbName;

In your code, you can just change the query in the FROM statement to your new database and table.

Or, if you were trying to start with a blank slate, then, after creating the new database, run the following:

mysqldump -u user -ppass -d olddb | mysql -u user -ppass -D newdb

which will copy your old schema to the new db.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top