Databases Reference
In-Depth Information
It's a good idea to make a backup of this file on CD or copy it across to another
computer.
3. Shut down the old server:
$ bin/mysqladmin --user root --password= the_mysql_root_password shutdown
4. Install the new server.
5. Configure and start the new server using the appropriate commands discussed
earlier in this chapter.
6. At this point, you should have a fresh installation of the MySQL server and asso-
ciated programs. If the new server version was installed using the same approach
as the old version, it's likely to have the same data directory. To check that your
databases are available on the new server, you can use the mysqlshow command to
connect to it and list the databases:
$ bin/mysqlshow --user root --password= the_mysql_root_password
You can also use the SHOW DATABASES command in the MySQL monitor (described
in Chapter 3).
If you used a different approach, or for some reason the new server doesn't know
about your old databases, you should now change your working directory to the
location of the new MySQL installation, and then load the databases from the
dump file you created earlier:
$ bin/mysql \
--user root \
--password= the_mysql_root_password \
< dump_of_all_databases_from_old_server.sql
Of course, you should use the password of the new MySQL server here.
7. Your new server should now have loaded all the databases from your old server.
One of these, the mysql database, contains grant tables that specify user access
levels. You should now check and upgrade these tables if necessary.
Under Linux, change to your MySQL base directory and type:
$ scripts/mysql_fix_privilege_tables \
--user=root \
--password= the_mysql_root_password
For a Windows MySQL server version 4.0.15 or newer, type:
C:\Program Files\MySQL\MySQL Server 5.0> bin/mysql \
--user=root \
--password= the_mysql_root_password \
--database=mysql \
< scripts\mysql_fix_privilege_tables.sql
Finally, for Mac OS X, type:
 
Search WWH ::




Custom Search