Comments - creating pivot table fails

10 years ago Daniel Bartholomew

Try this:

create table xsort engine=connect table_type=pivot tabname=test1 option_list='user=testuser';

testuser needs to have SELECT rights on the test1 table and should not have to enter a password.

The failure you're getting is because when connect accesses the data in the test1 table for use in the xsort table, it opens a new connection to the database. Since you didn't specify a user when creating the xsort table it uses whatever user was used when the table was created, root. When connect tries to open the connection it doesn't have a password so you get the Access denied... message.

 
2 years, 8 months ago Mario F

Thank you for your answer Daniel

That of creating a new user with no password and limited permission, it is also the approach suggested in the doc: https://mariadb.com/kb/en/connect-proxy-table-type/

 
10 years ago Daniel Bartholomew

There is also a password option for the option_list if you want to use a user that requires a password.

 
2 years, 8 months ago Mario F

Worth also saying that one must be careful with password inside option_list.

As stated in the doc: https://mariadb.com/kb/en/connect-proxy-table-type/

" ... it is often not advisable to write in clear a password that can be seen by all user able to see the table declaration by show create table ..."

Therefore, as Daniel himself said and as also stated in the doc, it is better to create a new user with no password and permissions only to specific tables

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.