| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In general, you should do the following when upgrading to MySQL 4.0 from an earlier version:
mysql_fix_privilege_tables script and is described
in 2.5.8 Upgrading the Grant Tables.
ISAM files to MyISAM files with the
mysql_convert_table_format database script. (This is a Perl script;
it requires that DBI be installed.) To convert the tables in a given database,
use this command:
shell> mysql_convert_table_format database db_name |
Note that this should only be used if all tables in the given database
are ISAM or MyISAM tables. To avoid converting tables
of other types to MyISAM, you can explicitly list the names
of your ISAM tables after the database name on the command
line. You can also issue a ALTER TABLE table_name TYPE=MyISAM
statement for each ISAM table to convert it to MyISAM.
To find out the table type for a given table, use this statement:
mysql> SHOW TABLE STATUS LIKE 'tbl_name'; |
DBD::mysql module). If you do, you should recompile
them, because the data structures used in `libmysqlclient.so' have changed.
The same applies to other MySQL interfaces as well, such as the Python
MySQLdb module.
MySQL 4.0 will work even if you don't do the above, but you will not be
able to use the new security privileges that MySQL 4.0 and you may run
into problems when upgrading later to MySQL 4.1 or newer. The ISAM file
format still works in MySQL 4.0 but it's deprecated and will be disabled
(not compiled in by default) in MySQL 4.1. MyISAM tables should be
used instead.
Old clients should work with a Version 4.0 server without any problems.
Even if you do the above, you can still downgrade to MySQL 3.23.52
or newer if you run into problems with the MySQL 4.0 series. In
this case, you must use mysqldump to dump any tables that
use full-text indexes and reload the dump file into the 3.23 server.
This is necessary because 4.0 uses a new format for full-text
indexing.
The following is a more complete list that tells what you must watch out for when upgrading to version 4.0:
mysql.user table.
See section GRANT.
To get these new privileges to work, you must update the grant tables.
The procedure is described in 2.5.8 Upgrading the Grant Tables.
Until you do this, all
users have the SHOW DATABASES, CREATE TEMPORARY TABLES,
and LOCK TABLES privileges. SUPER and EXECUTE
privileges take their value from PROCESS.
REPLICATION SLAVE and REPLICATION CLIENT take their
values from FILE.
If you have any scripts that create new users, you may want to change
them to use the new privileges. If you are not using GRANT
commands in the scripts, this is a good time to change your scripts to use
GRANT instead of modifying the grant tables directly..
From version 4.0.2 on, the option --safe-show-database is deprecated
(and no longer does anything). See section 5.3.3 Startup Options for mysqld Concerning Security.
If you get Access denied errors for new users in version 4.0.2 and up, you
should check if you need some of the new grants that you didn't need
before. In particular, you will need REPLICATION SLAVE
(instead of FILE) for new slaves.
safe_mysqld as a symlink to mysqld_safe.
--skip-innodb server
startup option. To compile MySQL without InnoDB support, run configure
with the --without-innodb option.
myisam_max_extra_sort_file_size and
myisam_max_extra_sort_file_size are now given in bytes
(they were given in megabytes before 4.0.3).
MyISAM/ISAM files is now
turned off by default. Your can turn this on by doing
--external-locking. (However, this is never needed for most users.)
| Old Name | New Name |
myisam_bulk_insert_tree_size | bulk_insert_buffer_size |
query_cache_startup_type | query_cache_type |
record_buffer | read_buffer_size |
record_rnd_buffer | read_rnd_buffer_size |
sort_buffer | sort_buffer_size |
warnings | log-warnings |
--err-log | --log-error (for mysqld_safe) |
The startup options record_buffer, sort_buffer and
warnings will still work in MySQL 4.0 but are deprecated.
| Old Name | New Name |
SQL_BIG_TABLES | BIG_TABLES |
SQL_LOW_PRIORITY_UPDATES | LOW_PRIORITY_UPDATES |
SQL_MAX_JOIN_SIZE | MAX_JOIN_SIZE |
SQL_QUERY_CACHE_TYPE | QUERY_CACHE_TYPE |
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=# instead of
SET SQL_SLAVE_SKIP_COUNTER=#.
mysqld startup options --skip-locking and
--enable-locking were renamed to --skip-external-locking
and --external-locking.
SHOW MASTER STATUS now returns an empty set if binary logging is not
enabled.
SHOW SLAVE STATUS now returns an empty set if slave is not initialized.
mysqld now has the option --temp-pool enabled by default as this
gives better performance with some operating systems (most notably Linux).
DOUBLE and FLOAT columns now honor the
UNSIGNED flag on storage (before, UNSIGNED was ignored for
these columns).
ORDER BY col_name DESC sorts NULL values last, as of
MySQL 4.0.11. In 3.23 and in earlier 4.0 versions, this was not
always consistent.
SHOW INDEX has two more columns (Null and Index_type)
than it had in 3.23.
CHECK, LOCALTIME and LOCALTIMESTAMP
are now reserved words.
|, &, <<,
>>, and ~)) is now unsigned. This may cause problems if you
are using them in a context where you want a signed result.
See section 12.5 Cast Functions.
UNSIGNED, the result will be unsigned. In other
words, before upgrading to MySQL 4.0, you should check your application
for cases where you are subtracting a value from an unsigned entity and
want a negative answer or subtracting an unsigned value from an
integer column. You can disable this behavior by using the
--sql-mode=NO_UNSIGNED_SUBTRACTION option when starting
mysqld. See section 12.5 Cast Functions.
MATCH ... AGAINST (... IN BOOLEAN MODE) with your tables,
you need to rebuild them with REPAIR TABLE table_name USE_FRM.
LOCATE() and INSTR() are case-sensitive if one of the
arguments is a binary string. Otherwise they are case-insensitive.
STRCMP() now uses the current character set when performing comparisons.
This makes the default comparison behavior case insensitive unless
one or both of the operands are binary strings.
HEX(string) now returns the characters in string converted to
hexadecimal. If you want to convert a number to hexadecimal, you should
ensure that you call HEX() with a numeric argument.
INSERT INTO ... SELECT always had IGNORE enabled.
In 4.0.1, MySQL will stop (and possibly roll back) by default in case of
an error unless you specify IGNORE.
mysql_drop_db(), mysql_create_db(), and
mysql_connect() are no longer supported unless you compile
MySQL with CFLAGS=-DUSE_OLD_FUNCTIONS. However, it is preferable
to change client programs to use the new 4.0 API instead.
MYSQL_FIELD structure, length and max_length have
changed from unsigned int to unsigned long. This should not
cause any problems, except that they may generate warning messages when
used as arguments in the printf() class of functions.
TRUNCATE TABLE when you want to delete all rows
from a table and you don't need to obtain a count of the number of rows that
were deleted. (DELETE FROM table_name returns a row count in 4.0,
and TRUNCATE TABLE is faster.)
LOCK TABLES or
transaction when trying to execute TRUNCATE TABLE or DROP
DATABASE.
BIGINT columns (instead
of using strings, as you did in MySQL 3.23). Using strings will still
work, but using integers is more efficient.
SHOW OPEN TABLES has changed.
mysql_thread_init() and
mysql_thread_end(). See section 19.1.14 How to Make a Threaded Client.
DBD::mysql module, use a recent
version. Version 2.9003 is recommended. Versions older than 1.2218 should
not be used because they use the deprecated mysql_drop_db() call.
RAND(seed) returns a different random number series in 4.0 than in
3.23; this was done to further differentiate RAND(seed) and
RAND(seed+1).
IFNULL(A,B) is now set to be the
more 'general' of the types of A and B. (The general-to-specific
order is string, REAL or INTEGER).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |