RE: MySQL Migration Toolkit Problem

"Ulrich Schmid" <[email protected]>
Newsgroups gmane.comp.db.mysql.mycc
Organization GDS Manufacturing Services
Message-ID <[email protected]>
You can use a backup/restore to transfer your databases
#dump the database
Shell> cd backupdir
Shell> mysqldump --opt -c -Q --tz-utc -u MYSQL_USERNAME -pMYSQL_PASSWORD -B
DBNAME > DBNAME.sql

#compress the dumpfile if you want
Shell> tar czpf DBNAME.tar.gz DBNAME.sql
#remove the uncompressed dumpfile
Shell> rm -f DBNAME.sql

#Restore database
Shell> cd backupdir
#uncompress compressed dumpfile
Shell> tar zxpf DBNAME.tar.gz 

#import with the mysql client
mysql -u MYSQL_USER -pMYSQL_PASSWORD DBNAME < DBNAME.sql

You can do so also for the mysql database where the grant tables are stored.

You might have to run commands as the MySQL root user on the new server
until you have the mysql database in place.
The mysql database structure hasn't changed much, there are two new tables
proc and procs_priv which will not be touched if you backup the copy. You
should exclude the help_... Tables from the transfer to use the new help
tables from mysql5 

To backup the mysql database use the following command
Shell> mysqldump --add-locks --disable-keys --extended-insert --lock-tables
--quick --no-create-info -c -Q  -u root -pMYSQL_ROOTPASSWORD mysql
columns_priv db func host tables_priv time_zone time_zone_leap_second
time_zone_name time_zone_transition time_zone_transition_type user user_info
> mysql.sql
To restore to the new server use
mysql -u root -pMYSQL_ROOTPASSWORD mysql < mysql.sql
After you import the mysql database on the new machine, execute mysqladmin
flush-privileges so that the server reloads the grant table information. 

#a short list of mysqldump options:
# --opt = is equal to the following options
# --add-drop-table = create a drop statemente for each table
# --add-locks =  Surround each table dump with LOCK TABLES and UNLOCK TABLES
# --create-options Include all MySQL-specific table options in the CREATE
TABLE statements. 
# --disable-keys = surround the INSERT statements with Disable/Enable Keys
to make restore faster
# --extended-insert = Use multiple-row INSERT syntax (smaller dump file and
faster restore)
# --lock-tables = look al tables before starting the dump.
# --quick = retrive rows one by one without buffering in memory befor
writing it out 
# --set-charset 
#
# additional options to use 
# to make work a incremental backup with the binary log
# -F, --flush_logs = Rotate the binary log 
#                    and flush the MySQL server log files before starting
the dump
#                    This option requires the RELOAD privilege.
#
# -c, --complete-insert = Use complete INSERT statements that include column
names
# -Q, --quote-names = Quote names
# --tz-utc = Add SET TIME_ZONE='+00:00' to the dump file so that TIMESTAMP
#           columns can be dumped and reloaded between servers in different
time zones.
#           also also protects against changes due to daylight saving time 
#           (--tz-utc is enabled by default)
# to include CREATE DATABASE IF NOT EXISTS db_name and USE db_name
statements 
# use option --databases, -B <databasename,[databasename]...>  

Ulrich Schmid

-----Original Message-----
From: Mads Sigvert [mailto:[email protected]] 
Sent: lunedì 22 maggio 2006 13:48
To: [email protected]
Subject: MySQL Migration Toolkit Problem

Hi

I got a old server running Mysql 4.x

and i am setting up a new, running MySql 5. I have several users and
databases i need to move to the new database. So i chose to use Migration
tool for this purpos. How ever, when i run it, and its about to Reverse
Engineering the source database i get this error:

"The schema could not be reverse engineered (error: 0).
ReverseEngineeringMysqlJdbc.reverseEngineer :The function
ReverseEngineeringMysql:reverseEngineer() returned the following error:
Could not execute SHOW CREATE TABLE statement.
Details:
com.mysql.grt.Grt.callGrtFunction(Unknown Source)
com.mysql.grt.modules.ReverseEngineeringMysqlJdbc.reverseEngineer(Unknown
Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.grt.Grt.callModuleFunction(Unknown Source) "

How come?
Is there a easy way to get my users and tabels from mysql 4 to 5 ?



--
MySQL GUI Tools Mailing List
For list archives: http://lists.mysql.com/gui-tools
To unsubscribe:    http://lists.mysql.com/[email protected]


-- 
MySQL GUI Tools Mailing List
For list archives: http://lists.mysql.com/gui-tools
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.