Most developers who install MySQL via apt-get on Ubuntu will know that it comes with pre-defined settings. The directory where MySQL stores its data is one such setting. The default location is /var/lib/mysql. There are times when this location will have to be changed. But a lot of developers face difficulty in this regard. This article will guide you through the process. Use the command line prompts provided in the article to arrive at desired results. After you have completed the steps mentioned in this article, make sure you restart MySQL. And voila, MySQL will use the new directory specified by you to store data.