SparklingRaven
Posts: 7
Joined: Tue Dec 24, 2019 4:32 am

MariaDB syntax help

Tue Dec 24, 2019 4:38 am

I’m following the second method of this tutorial to install NextCloud on my Pi.

When I get to this step:

Give all permissions to the new user on this database

Code: Select all

GRANT ALL PRIVILEGES ON nextcloud.* TO ‘nextcloud’@localhost IDENTIFIED BY ‘XXX’;
I get an error saying “you have an error in your syntax – check your version of MariaDB’s manuals.” I’ve copy-pasted the command exactly except to change the XXX to the password I chose in the previous step. I did not remove the single quote marks. Unfortunately I’m not familiar with MariaDB and although I did consult their manuals, I haven’t yet figured it out. I also tried IDENTIFIED BY PASSWORD which was in their manual and that didn’t work either. I’ve reached out to the author in the comments (my comment is still awaiting moderation approval) but I figured it’s a holiday and he might be busy, and perhaps someone here could get to it sooner.

User avatar
DougieLawson
Posts: 37732
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MariaDB syntax help

Tue Dec 24, 2019 12:05 pm

Code: Select all

'nextcloud'@'localhost'
Note the extra apostrophes.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

SparklingRaven
Posts: 7
Joined: Tue Dec 24, 2019 4:32 am

Re: MariaDB syntax help

Tue Dec 24, 2019 10:50 pm

Aha, thanks!

SparklingRaven
Posts: 7
Joined: Tue Dec 24, 2019 4:32 am

Re: MariaDB syntax help

Wed Dec 25, 2019 5:30 am

Unfortunately that has not fixed the problem. Here is a screenshot. I have obscured the password I chose in red (just to make it easier to tell against the black.)
43438B6F-DAB9-4B39-A813-7A3C51C9707A.jpeg
43438B6F-DAB9-4B39-A813-7A3C51C9707A.jpeg (129.41 KiB) Viewed 679 times

User avatar
rpdom
Posts: 16388
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: MariaDB syntax help

Wed Dec 25, 2019 5:47 am

You've got some weird quote marks around the password. Just use plain single quotes.

Code: Select all

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.543 sec)

SparklingRaven
Posts: 7
Joined: Tue Dec 24, 2019 4:32 am

Re: MariaDB syntax help

Wed Dec 25, 2019 8:05 am

Ooh it must be coming from the copy paste. Thank you, will try that!

User avatar
rpdom
Posts: 16388
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: MariaDB syntax help

Wed Dec 25, 2019 8:32 am

Some computers (mostly Apples, I think) have a nasty habit of putting "Smart Quote" marks around things even when you type normal ones. It is an annoying feature.

SparklingRaven
Posts: 7
Joined: Tue Dec 24, 2019 4:32 am

Re: MariaDB syntax help

Fri Dec 27, 2019 2:21 am

Yeah, I was initially typing commands but then I was so sure I was messing something up that I copy pasted that command, and I kept just pressing up in terminal to repeat the command and changed whatever was pointed out...never noticing the smart quotes.

Return to “Other programming languages”