Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new deployments on mysql 8.0 #232

Closed
rg2011 opened this issue Jan 22, 2024 · 1 comment · Fixed by #233
Closed

Support new deployments on mysql 8.0 #232

rg2011 opened this issue Jan 22, 2024 · 1 comment · Fixed by #233

Comments

@rg2011
Copy link
Contributor

rg2011 commented Jan 22, 2024

Trying to deploy a new keystone server with a mysql database in version 8.0 yields the following error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'IDENTIFIED BY 'keystone' at line 1.

It is because of these commands in the launch script:

CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
IDENTIFIED BY 'keystone';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
IDENTIFIED BY 'keystone';

Mysql 8 deprecates the syntax GRANT ... IDENTIFIED BY, requiring two separate statements (CREATE USER and GRANT PRIVILEGES). See https://stackoverflow.com/questions/13357760/mysql-create-user-if-not-exists

Mysql 5.7, on the other hand, might not support CREATE USER ...IF NOT EXISTS. So a full solution to this problem should try both syntaxes to support both versions.

@fgalan
Copy link
Member

fgalan commented Jan 22, 2024

PR #233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants