CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
Pages: [1] 2

Author Topic: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?  (Read 5648 times)

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 10, 2012, 04:30:12 am
Reading through the instructions for the 4.1 upgrade, I see that MySQL will require the SUPER privilege now. Checking my syntax when I created the database, that is not one of the privileges I knew to grant. I issued:

Code: [Select]
mysql> CREATE DATABASE cir_civicrm;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON cir_civicrm.* TO 'ucir_civicrm'@'localhost' IDENTIFIED BY '************';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON cir_civicrm.* TO 'ucir_civicrm'@'127.0.0.1' IDENTIFIED BY '************';
mysql> FLUSH PRIVILEGES;

How may I add the SUPER privilege to the existing database? Should I just add that SUPER keyword to the old list, or specify it singly since the other grants have already been granted, or... ???
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 10, 2012, 07:24:10 am

i think in 5.0 only root has SUPER privileges (which in turn has TRIGGER privileges)

mysql 5.1 has fixed this issue and the trigger privileges are separate

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 10, 2012, 01:51:13 pm
This page of the documentation seems to suggest it is there in the 5.0.95 which Ubuntu 8.04 shipped with.

http://dev.mysql.com/doc/refman/5.0/en/privileges-provided.html#priv_super

Again, I never knew there was such a privilege, so how to retroactively add that privileged after the fact?
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 10, 2012, 03:47:41 pm
I believe you need to use:
Code: [Select]
GRANT SUPER ON *.* TO 'ucir_civicrm'@'localhost';
However I tested this on 5.1.

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 10, 2012, 05:47:35 pm
I get this back on MySQL 5.0.95:

Code: [Select]
ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
Poking around a bit, it appears that the user table which has column Super_priv is not where perms are coming from. The perms actually are coming from the db table which doe not have a column for the super perm. I guess upgrading further waits until after the server upgrade.

Thank you just the same.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 11, 2012, 06:28:02 am
Are you sure you granted the permission on *.* and not on one of the DB's? (like cir_civicrm.* ) The super privilege is a global privilege and cannot be granted on a db. If you try you will get the error you reported.
The super privilege is still stored in the user table in MySQL 5.1. (I check with the DESC command).

Code: [Select]
Without SUPER:
mysql> show grants for 'testuser'@'localhost';
+------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for testuser@localhost                                                                                                                   |
+------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'testuser'@'localhost' IDENTIFIED BY PASSWORD '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'                               |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON `test01`.* TO 'testuser'@'localhost' |
+------------------------------------------------------------------------------------------------------------------------------------------------+

With SUPER:
mysql> show grants for 'testuser'@'localhost';
+------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for testuser@localhost                                                                                                                  |
+------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SUPER ON *.* TO 'testuser'@'localhost' IDENTIFIED BY PASSWORD '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'                                |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON `test01`.* TO 'testuser'@'localhost' |
+------------------------------------------------------------------------------------------------------------------------------------------------+

It appears that the first row of grant results is coming from the user table and the second from the db table.

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 12, 2012, 03:35:05 pm
Quote from: britebyte on April 11, 2012, 06:28:02 am
Are you sure you granted the permission on *.* and not on one of the DB's? (like cir_civicrm.* ) The super privilege is a global privilege and cannot be granted on a db. If you try you will get the error you reported.
The super privilege is still stored in the user table in MySQL 5.1. (I check with the DESC command).

Oh... well then I would not want to grant all ID's SUPER rights to all db's, which it sounds like the "grant to *.*" would do. Yes, I tried specifically to the one CiviCRM DB.

I have some SELECT-only (read-only) ID's and what not. I would not want those to end up with SELECT+SUPER!  :o
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 13, 2012, 06:32:38 am

Code: [Select]
GRANT SUPER ON *.* TO 'ucir_civicrm'@'localhost';

In this syntax the grant is ON *.* but only TO the specified user (that the CiviCRM App runs as). No effect on other users.
In any case you should probably upgrade to MySQL 5.1.

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 14, 2012, 06:19:10 am
Quote from: britebyte on April 13, 2012, 06:32:38 am
In this syntax the grant is ON *.* but only TO the specified user (that the CiviCRM App runs as).

Oh... So only the ID which has full access to the CiviCRM database would become SUPER for the entire server (*.*)? I think we could deal with that scenario.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 22, 2012, 01:44:27 pm
Quote from: mdlueck on April 14, 2012, 06:19:10 am
Oh... So only the ID which has full access to the CiviCRM database would become SUPER for the entire server (*.*)? I think we could deal with that scenario.

britebyte, did I understand what you meant?
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 23, 2012, 06:56:26 am
Quote from: mdlueck on April 22, 2012, 01:44:27 pm

britebyte, did I understand what you meant?

Yes, that is correct. That grant statement only affects the specified account. Again with the caveat: I don't have 5.0 installed to test on at the moment as we are using 5.1. But, if the feature is there is 5.0 it is most likely the same.

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 23, 2012, 02:25:03 pm
Thanks britebyte for the confirm. I will consider testing the upgrade on our test instance of Civi.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
March 29, 2013, 08:28:18 am
I am finally back to move this domain onto a server with higher build of MySQL: 5.1.67

I am attempting to create a user account for the new database, and am getting an error I believe since I included SUPER in the list of credentials:

Code: [Select]
mysql> CREATE DATABASE cir_civicrm;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, SUPER ON cir_civicrm.* TO 'ucir_civicrm'@'localhost' IDENTIFIED BY 'realpasswordhere';
ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES

I thought upgrading to MySQL 5.1 was suppose to eliminate this trouble granting SUPER to the ID that CiviCRM is going to use to connect to the DB.

I am seeing posts (outside of CiviCRM) that suggest even with MySQL 5.1.* it is necessary to grant the SUPER permission as I did before running on MySQL 5.0.x.  ???

What is going on?
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

lolas

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
    • Freeform Solutions
  • CiviCRM version: Several
  • CMS version: Drupal
  • MySQL version: 5.1+
  • PHP version: Several
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
March 31, 2013, 05:22:35 pm
  • Since you are at version 5.1.6+ with 5.1.67 you would want to use the new TRIGGER permission instead. Replace the work SUPER with TRIGGER.
  • If you were on 5.1 but less than 5.1.6 then the error message is telling you that you are trying to grant a global privilege on a single database. You can break out the super privilege into a separate line

Version 5.1.6+:
Code: [Select]
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, TRIGGER ON cir_civicrm.* TO 'ucir_civicrm'@'localhost' IDENTIFIED BY 'realpasswordhere';

Version 5.1 but less than 5.1.6:

Code: [Select]
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON cir_civicrm.* TO 'ucir_civicrm'@'localhost' IDENTIFIED BY 'realpasswordhere';
GRANT SUPER ON *.* TO 'ucir_civicrm'@'localhost';
Freeform Solutions provides technology and management consulting, website and database development, and managed internet hosting solutions for not-for-profit organizations (NFPs).

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?
April 02, 2013, 05:47:04 pm
Thank you for the details. I will change the permissions to use TRIGGER next time I am doing a Civi upgrade.

For now I have the work-around you suggested second.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Granting MySQL 5.0.95 Super priv to support Civi 4.1 upgrade, how?

This forum was archived on 2017-11-26.