Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to migrate a mysql databases from a old server to a new server ( Redhat ) , can advise what I need to do ,is it just copy all .frm , .MYI & .MYD files to new server will do ? or I need to do export and inport data ? thx
Unless you are running the exact same mysql version I'd imagine you could get incompatibility issues just by copying the raw files. For that reason I'd use mysqldump.
I only found some .frm , .MYI , .MYD in /var/lib/mysql/mysql directory , I would like to ask is that mean there is only a mysql db in the system ? if yes, the db name is "mysql" ? thx
The mysql database in a mysql server is the database that is used to administer user accounts and other information that is internal to a mysql server. If that is the only directory in /var/lib/mysql, then I would say yes, it seems that there are no other databases.... not a very useful mysql server.
Since this is a database that is internal to mysql itself, I would be hesitant to blindly copy it to another installation.
I want to migrate the mysql db from Debian to Redhat , the best medhod is export the data and then import to it ? can I use phpmyadmin to do all the migration steps ? thx
you can use phpmyadmin for those things. but I still recommend mysqldump.And to get a consistent backup, you need to lock the tables first,then fire mysqldump
@freelinuxtutorials: mysqldump does the locks as reqd.
@OP: only dump/import app schems, not the metadata eg mysql schema, unless the DB versions are the same; even then it may have issues unless the 2 systems are identical.
What will be reqd is to use SHOW GRANTS to get a list of users and access perms.
you want mysqldump for that, you should have it installed. Easy peasy
Code:
mysqldump -u DBUSER -p DBNAME > DBNAME.sql
and
Code:
mysqlimport
The man pages for both will give you more in depth information
I found the below command to export all database by one time .
To dump all databases, use the --all-databases option:
shell> mysqldump --all-databases > all_databases.sql
I also try to use mysqlimport to import it to another server , but it pops the database is not available , I need to create all databases before run mysqlimport ? if no need , is there method that is easy import the databases ? thx
I'd look in the generated testdb.sql file if it has statements to
create a DB as well as tables. I don't have access to such ancient
versions of MySQL, so can't test this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.