Page Tools:
Wiki Relationships:
Admin Tools:
How to change the mysql database location
- Identify the database files you wish to migrate into the new data directory
You can use the following command to list the current databases in mysql
mysqlshow -u root -p
Keep this list available as you will reference it in a later step - Shutdown the MySQL database, if it is running
mysqladmin -u root -p shutdown
Note: You should make a backup copy of each file you're editing before modifying the contents
You need to change:
[mysqld_safe] datadir = /opt/oss/var/mysql
to
[mysqld_safe] datadir = /opt/oss/var/mysql/data
mkdir -p /optoss/var/mysql/data
You may need to modify the directory settings using chown and chmod
mv test /opt/oss/var/mysql/data
Note: You can use the copy (cp) command instead if you prefer. Remember to remove the copied files once the migration is complete
You will need to move/copy each database into the new data directory
openpkg rc mysql start
The database files will now be managed under the new data directory. If you encounter any problems during startup, you check the hostname.err file located in the data directory.
Most Recent |
Most Popular |
Most Active Categories |
| Back To Top | Add New Article | Printable Page |
Top Level > Development > Databases > MySQL

Testing
