Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Nov 222010

Initialize MySQL Data Directory


When you compiled a new MySQL server, it is needed to create a default data directory.

To do so, you need to use the mysql_install_db command.

# bin/mysql_install_db --user=mysql \
    --basedir=/opt/mysql/mysql \

The --datadir is the target directory for storing the database files, where --basedir specifies the MySQL server base directory.


 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>