[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Extracting MySQL Data?



----- Original Message -----
Subject: RE: [cobalt-users] Extracting MySQL Data?


> At 10:54 PM 03/12/03 +0000, you wrote:
> > > Anyone have any idea on that one?
> > >
> > > -Sergio
> >
> >Have you created a user with the same rights on the new server as the
old?
> >
> >Phil
>
>
> You should copy the database 'mysql' from the other server and all your
> users will be there.
>
> - Bill

Handy shell commands when dealing with mysql on raq4's. This could wrap the
text!

Listing the contents of the mysql dir:
ls -al /home/mysql

set mysql password for root:
mysql> set password for root=password('NEW_PASSWORD');

Backing up a data base (not logged in to mysql!):
root password is needed!
mysqldump -p --opt USERS_DATABASE_NAME > USERS_DATABASE_NAME.sql

Creating a new database:
mysql -u root -p
root password is needed!

create database USERS_DATABASE_NAME;

grant select, insert, update, delete, create, drop, alter, index on
USERS_DATABASE_NAME.* to USER@localhost identified by 'USERS_PASSWORD';
(Should be 1 line above)


Restoring a database:
root password is needed!
mysql -p USERS_DATABASE_NAME < USERS_DATABASE_NAME.sql

exit mysql:
\q

David Hahn
PageKeeper Service
http://www.pagekeeperservice.com