Page 1 of 1

Same username & password for localhost WordPress sites

PostPosted: 29. November 2019 02:16
by Lars_Lemming
Let me be honest up front, 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 into the PhPMyAdmin pannel, where I create the four databases and - after this - into the "SQL" tap where I enter the following:
GRANT ALL on byemeries.* 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 anyone 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 completely wrong way!

Re: Same username & password for localhost WordPress sites

PostPosted: 29. November 2019 10:38
by Altrea
You didn't used the default single quotes wrapping your password.
You used ‘ and ’ but need to use ' '