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

Add mysql user if not root #45

Merged
merged 2 commits into from
Jan 9, 2018
Merged

Add mysql user if not root #45

merged 2 commits into from
Jan 9, 2018

Conversation

Natkeeran
Copy link
Contributor

@Natkeeran Natkeeran commented Jan 3, 2018

Github issue

Changes

If the user wants to use a drupal user other than root, that user needs to be created. Otherwise, ansible will fail. This PR creates the mysql user and gives permissions for the drupal database for that user.

Testing

@dannylamb

@Natkeeran Natkeeran changed the title Mysql user Add mysql user if not root Jan 3, 2018
@dannylamb
Copy link
Member

vagrant up with drupal_db_user: not_root

@dannylamb
Copy link
Member

👍 works as expected.

ubuntu@claw:~$ mysql -u not_root -pislandora
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 64
Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use drupal8
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from no
Display all 240 possibilities? (y or n) 
mysql> select * from node;
+-----+------+----------------------+--------------------------------------+----------+
| nid | vid  | type                 | uuid                                 | langcode |
+-----+------+----------------------+--------------------------------------+----------+
|   1 |    1 | islandora_collection | 0dffecd7-1600-45ac-a06a-16bef70578e8 | en       |
+-----+------+----------------------+--------------------------------------+----------+
1 row in set (0.00 sec)

mysql> 

@dannylamb dannylamb merged commit c74b185 into Islandora-Devops:master Jan 9, 2018
@DigitLib
Copy link
Contributor

DigitLib commented Jan 11, 2018

After ISLANDORA_DISTRO="centos/7" vagrant up it failed in
TASK [mysql : Ensure MySQL users are present.] *********************************
Thursday 11 January 2018 17:58:08 +0100 (0:00:00.014) 0:00:15.118 ******
failed: [default] (item=None) => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
After putting under comment
mysql_users:
name: "{{ drupal_db_user }}"
host: "%"
password: "{{ drupal_db_password }}"
priv: "{{ drupal_db_name }}.*:ALL"
when: drupal_db_user != 'root'

mysql continue well...

@dannylamb
Copy link
Member

@DigitLib I've seen that recently, too. But I was building for Ubuntu and it would only happen if I attempted to provision twice (due to Fits failing) while still using the root mysql user.

I'll report this on Islandora/documentation#762

@seth-shaw-unlv
Copy link
Contributor

I was experiencing the same problem as @DigitLib building on CentOS 7. Attempting to reprovision the vagrant box (i.e. issuing vagrant up --provision after it has provisioned once before) would cause this error. The FITS issue was not related.

@Natkeeran 's PR fixes it.

@Natkeeran Natkeeran deleted the mysql_user branch April 18, 2018 17:54
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 this pull request may close these issues.

4 participants