Question :
I have a 1TB Western Digital External HDD and I was wondering if I can turn it into a MySQL Database? The HDD itself is connected to my router via USB (BT Home Hub 3) and I would like to experiment with some database ideas at home. Is there any special steps I can take to do what I seek, or is it a hopeless endeavour?
Answer :
It is not a silly question as these days when databases are growing beyond gigs this is becoming a common practice. You can do that by moving all your files in current data directory to the new location and make changes in (datadir) in your my.cnf / my.ini accordingly
-
Stop MySQL (service mysql stop)
-
Make a dir in the HDD (mkdir /mysqldata)
-
Move your data files to HDD (cp -rp /var/lib/mysql/* /mysqldata)
-
Search datadir in my.cnf (cat /etc/mysql/my.cnf | grep datadir )
-
Change path accordinly (datadir = /var/lib/mysql To: datadir = /mysqldata )
-
Start MySQL (service mysql start)