0

Let me be honest upfront, I am a novice when it comes to PHP and PhPMyAdmin, but I used to have something similar on an old computer which has now been scrapped - so I know it is possible.

I want to run, work on and modify several different websites on my XAMPP based localhost installation, and therefor I first make a seperate folder for each of these websites in "htdocs", one named byemeries In these folders, I open the rename the "wp-config-sample.php" files to "wp-config.php" and open them to edit the following lines so they read:

'DB_NAME', 'byemeries'

'DB_USER', 'Lars'

'DB_PASSWORD', 'MyPassword'

(the password is not actually this, but consist of 13 letters where two are in capital letters and two numbers - without any spaces in it).

'DB_HOST', 'localhost'

I then go in to the PhPMyAdmin pannel, where I create the four databases and - after this - in to the "SQL" tap where I enter the following:

GRANT ALL on byemery.* to ‘Lars’@’localhost’ IDENTIFIED BY ‘MyPassword’;

GRANT ALL on energreen.* to ‘Lars’@’localhost’ IDENTIFIED BY ‘MyPassword’;

GRANT ALL on flexsolution.* to ‘Lars’@’localhost’ IDENTIFIED BY ‘MyPassword’;

GRANT ALL on hjertestarterskabe.* to ‘Lars’@’localhost’ IDENTIFIED BY ‘MyPassword’;

I then press the "GO" button but am then presented with the following message:

Error SQL query: GRANT ALL on flexsolution.* to ‘Lars’@’localhost’ IDENTIFIED BY ‘MyPassword’ MySQL said: Documentation 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near "MyPassword" at line 1

Can any one tell me what I am doing wrong - perhaps it is an obvious mistake (told you I am a novice), and perhaps I am going about it completly wrong way!

user3783243
  • 5,368
  • 5
  • 22
  • 41
Lars
  • 1
  • Use quotes, not backticks for the password string... or not smart quotes, hard to tell what you have there but it is not a `'` which it should be, or possible `"` if you aren't using ansi quotes. – user3783243 Nov 28 '19 at 23:45
  • Possible duplicate of [When to use single quotes, double quotes, and backticks in MySQL](https://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks-in-mysql) – user3783243 Nov 28 '19 at 23:45
  • Since you're using phpMyAdmin, a graphical tool for managing databases, you could use the "User accounts" tab to graphically create your new users, rather than typing in the SQL by hand. – Isaac Bennetch Jan 26 '20 at 03:46

1 Answers1

0

For GRANT IDENTIFIED isn't allowed

so use

GRANT ALL PRIVILEGES  on byemery.* to 'Lars'@’localhost’;

GRANT ALL PRIVILEGES on energreen.* to ‘Lars’@’localhost’;

GRANT ALL PRIVILEGES on flexsolution.* to ‘Lars’@’localhost’;

GRANT ALL PRIVILEGES on hjertestarterskabe.* to `Lars`@`localhost`;
nbk
  • 45,398
  • 8
  • 30
  • 47