0

I am trying to install the MySQL version 5.7.12 into RedHat in a non default data path.

The installation syntax used

/app/mysql/5.7/bin/mysqld --initialize --user=mysql --basedir=/app/mysql/5.7 --datapath=/app/mysql/data

/app/mysql/data is a softlink to /data

I got the following error.

2016-05-19T02:57:28.087915Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicitdefaults_for_timestamp server option (see documentation for more details).
2016-05-19T02:57:28.090891Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2016-05-19T02:57:28.090910Z 0 [ERROR] Aborting
3
  • the data directory has files in it. Aborting. - is there anything inside /data?
    – jkavalik
    May 19, 2016 at 6:18
  • No. That's why it's a strange message. ls -l /data total 0
    – Haans
    May 19, 2016 at 10:11
  • Does MySQL have permissions to access the new datadir? Apparmor/selinux running and maybe blocking access?
    – jkavalik
    May 19, 2016 at 10:17

2 Answers 2

1

bin/mysqld --initialize --user=mysql --datadir=/app/mysql/data --basedir=/app/mysql/5.7

I specified --user parameter and the error no longer appearing.

2016-05-19T10:27:17.440353Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-19T10:27:17.661087Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-05-19T10:27:17.713953Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-05-19T10:27:17.777797Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: xxxxxxx-xxxx-xxxx-xxx-xxxxxxx.
2016-05-19T10:27:17.780306Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-05-19T10:27:17.781230Z 1 [Note] A temporary password is generated for root@localhost: xxxxxxx
1
  • and also change command string, was data path, now --datadir :)
    – a_vlad
    Nov 17, 2016 at 5:36
0

Please ensure MySQL user has permission to access these files . Moreover I see you are using datapath.tthis is wrong. Please use argument datadir . And then give a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.