MySQL DBA Tips Corner

     Return to the MySQL DBA Tips Corner.

Notes on mysql_install_db - (Release 3.23)

by Jeff Hunter, Sr. Database Administrator


  1. Introduction
  2. Problems Running mysql_install_db


The mysql_install_db script is used to create the MySQL grant tables with default privileges. This script is usually executed only once, when first installing MySQL on the system. The mysql_install_db script creates the mysql database which will hold all database and user privileges, the test database which you can use to test MySQL, and also privilege entries for the user that run mysql_install_db and a root user (without any passwords).
Problems Running mysql_install_db
This section lists the problems you might encounter when attempting to run the mysql_install_db script:

Keep in mind that you can start mysqld manually using the --skip-grant-tables option and add the privilege information yourself using mysql:
  $ BINDIR/safe_mysqld --skip-grant-tables &
  $ BINDIR/mysql -u root mysql

From mysql, manually execute the SQL commands in mysql_install_db. Make sure you run mysqladmin flush-privileges or mysqladmin reload afterward to tell the server to reload the grant tables.

Copyright (c) 1998-2018 Jeffrey M. Hunter. All rights reserved.

All articles, scripts and material located at the Internet address of is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at

I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
Monday, 25-Jul-2005 20:14:51 EDT
Page Count: 9720