Not the answer you need?
Register and ask your own question!

Unable to initialize data directory

unixroninunixronin ContributorCurrent User Role Beginner
When MySQL 5.7 went GA, we tried to test the GA release and were unable to do so because we could not get it to create a data directory. I now have a request to install Percona Server 5.7 (on a Red Hat Linux 6.7 VM) and the same problem is occurring. Installing the packages creates /var/lib/mysql/, /var/lib/mysql-files/, and /var/lib/mysql-keyring/, all correctly owned by user mysql, but mysqld --initialize --user=mysql simply quits after doing absolutely nothing:
hostname:root:/usr:17 # /usr/sbin/mysqld --initialize --user=mysql -V
/usr/sbin/mysqld Ver 5.7.11-4 for Linux on x86_64 (Percona Server (GPL), Release 4, Revision 5c940e1)
hostname:root:/usr:18 # ls -Al /var/lib/mysql*
/var/lib/mysql:
total 0

/var/lib/mysql-files:
total 0

/var/lib/mysql-keyring:
total 0
hostname:root:/usr:19 #

What are we missing? Does anyone know what is the problem here? We have not accomplished a single successful MySQL 5.7 or Percona Server 5.7 installation, because mysql_install_db is gone since 5.7.6, telling us to use mysqld --initialize instead, and mysqld --initialize doesn't do anything. We can't even get it to tell us why it's failing.


Update:
We were able to perform a clean install of 5.6.30 and then upgrade in place to 5.7.11 without incident. But I would dearly love to know why we cannot get a clean 5.7.11 install to work.

Comments

  • jriverajrivera Percona Support Engineer Percona Staff Role
    Remove the '-V' at the end of the line, use this instead:
    mysqld --initialize --user=mysql --datadir=/var/lib/mysql
    

    or you can also use this if you want to use your existing my.cnf file:
    mysqld --defaults-file --initialize --user=mysql
    
  • unixroninunixronin Contributor Current User Role Beginner
    Thanks, we'll give that a try. It'd be nice if Oracle's documentation mentioned those additional options.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.