|
Home
/ Technical Support / MySQL
Key Offerings:
B2B and B2C E-Business
Solutions
Offshore
Software Development Outsourcing
Strategic Consulting
Offshore Software Outsourcing
ALTOROS Systems
is headquartered in Tampa, Florida and maintains an office
near Boston, Massachusetts and technology development center
in Belarus and Russia. ALTOROS specializes on providing value-added
e-commerce and web-based software development and offshore
software outsourcing services to emerging enterprises helping
them successfully plan and implement business initiatives.
Contact Us for more
information.
Upgrading From Version 3.23 to Version 4.0
You can use your old datafiles without any modification with Version 4.0. If you want to move your data from a MySQL 4.0 server to an older server, you have to use mysqldump.
Old clients should work with a Version 4.0 server without any problems.
The following lists tell what you have to watch out for when upgrading to version 4.0;
· MySQL 4.0 has a lot of new privileges in the mysql.user table. See GRANT.
To get these new privileges to work, one must run the mysql_fix_privilege_tables script. Until this script is run 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 creates 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.
In version 4.0.2 the option --safe-show-database is deprecated (and no longer does anything). See Privileges options.
If you get access denied errors for new users in version 4.0.2, 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.
· The startup parameters myisam_max_extra_sort_file_size and myisam_max_extra_sort_file_size are now given in bytes (was megabytes before 4.0.3). External system locking of MyISAM/ISAM files is now turned of by default. One can turn this on by doing --external-locking. (For most users this is never needed).
| · The following startup variables/options have been renamed: From |
to. |
| 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 |
The startup options record_buffer, sort_buffer and warnings will still work in MySQL 4.0 but are deprecated.
| · The following SQL variables have changed name. From |
to. |
| 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 |
The old names still work in MySQL 4.0 but are deprecated.
· You have to use SET GLOBAL SQL_SLAVE_SKIP_COUNTER=# instead of SET SQL_SLAVE_SKIP_COUNTER=#.
· Renamed mysqld startup options --skip-locking to --skip-external-locking and --enable-locking to --external-locking.
· DOUBLE and FLOAT columns now honour the UNSIGNED flag on storage (before, UNSIGNED was ignored for these columns).
· ORDER BY column DESC now always sorts NULL values first; in 3.23 this was not always consistent.
· SHOW INDEX has 2 columns more (Null and Index_type) than it had in 3.23.
· SIGNED is a reserved word.
· The result of all bitwise operators |, &, <<, >>, and ~ is now unsigned. This may cause problems if you are using them in a context where you want a signed result. See Cast Functions.
· Note: when you use subtraction between integer values where one is of type 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 behaviour by using the --sql-mode=NO_UNSIGNED_SUBTRACTION option when starting mysqld. See Cast Functions.
· To use MATCH ... AGAINST (... IN BOOLEAN MODE) with your tables, you need to rebuild them with ALTER TABLE table_name TYPE=MyISAM, even if they are of MyISAM type.
· 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 doing comparisons, which means that the default comparison behaviour now is case-insensitive.
· 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.
· In 3.23, INSERT INTO ... SELECT always had IGNORE enabled. In 4.0.1, MySQL will stop (and possibly roll back) in case of an error if you don't specify IGNORE.
· safe_mysqld is renamed to mysqld_safe.
· The old C API functions mysql_drop_db, mysql_create_db, and mysql_connect are not supported anymore, unless you compile MySQL with CFLAGS=-DUSE_OLD_FUNCTIONS. Instead of doing this, it is preferable to change the client to use the new 4.0 API.
· In the 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.
· You should use TRUNCATE TABLE when you want to delete all rows from a table and you don't care how many rows were deleted. (Because TRUNCATE TABLE is faster than DELETE FROM table_name).
· You will get an error if you have an active LOCK TABLES or transaction when trying to execute TRUNCATE TABLE or DROP DATABASE.
· You should use integers to store values in BIGINT columns (instead of using strings, as you did in MySQL 3.23). Using strings will still work, but using integers is more efficient.
· Format of SHOW OPEN TABLE has changed.
· Multi-threaded clients should use mysql_thread_init() and mysql_thread_end(). See Threaded clients.
· If you want to recompile the Perl DBD::mysql module, you must get Msql-Mysql-modules version 1.2218 or newer because the older DBD modules used the deprecated 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).
|