1uke_
Posts: 74
Joined: Thu Jul 07, 2016 9:19 pm

[LAMP server] - Need help with last part of WordPress install

Thu May 30, 2019 11:03 am

Hello,

I have recently set up a LAMP server and installed WordPress using this guide - https://opensource.com/article/18/10/se ... spberry-pi

I have got to the final part of the guide 'WordPress configuration'

I add the following details to the set up

Code: Select all

Database Name:      wordpress
User Name:          root
Password:            Secret
Database Host:    localhost
Table Prefix:          wp_
But I get the following message.

'Error establishing connection to database'

If I check in /var/html/www

I can see that wp-config.php has not been added yet.

If I navigate to /var/www/html/ right click and choose edit then manually update and save as wp-config.php I get the message

'Error saving file. Permission denied'

Can anyone help by suggesting how I overcome this final hurdle?

Andyroo

Re: [LAMP server] - Need help with last part of WordPress install

Thu May 30, 2019 1:06 pm

The reason you cannot edit the file is that all files in /var/html/www are owned by www-data and not Pi so you have to prefix your edit command with sudo

The ‘Error establishing connection to database’ could be a couple of reasons:

1) The database server is not running on the Pi.
2) The user / password you are using are incorrect.

If you loaded phpmyadmin I would use that to check the database is running and the credentials.
If not, try

Code: Select all

/etc/init.d/mysql status
and see what the error is.

By the way - it’s not good practise (but very common in tutorials) to use the root user as the database access. It is much safer to create a user with only access to the WP tables...

1uke_
Posts: 74
Joined: Thu Jul 07, 2016 9:19 pm

Re: [LAMP server] - Need help with last part of WordPress install

Thu May 30, 2019 4:48 pm

Here is what I see when I run the command

● mariadb.service - MariaDB 10.1.38 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-05-30 14:34:15 BST; 3h 12min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 571 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─571 /usr/sbin/mysqld

May 30 14:34:06 raspberrypi systemd[1]: Starting MariaDB 10.1.38 database se…...
May 30 14:34:10 raspberrypi mysqld[571]: 2019-05-30 14:34:10 1996353328 [Not…...
May 30 14:34:15 raspberrypi systemd[1]: Started MariaDB 10.1.38 database server.
Hint: Some lines were ellipsized, use -l to show in full

Can you tell me what this means or what I need to do next

Andyroo

Re: [LAMP server] - Need help with last part of WordPress install

Thu May 30, 2019 4:56 pm

That says the database is up and running so it infers the user and or password is incorrect.

you can try logging on from the command line with

Code: Select all

mysql -u <user> -p <password>
This will enter mysql and you get back to the command line with

Code: Select all

exit
Do you have a link to the instructions you where following?

1uke_
Posts: 74
Joined: Thu Jul 07, 2016 9:19 pm

Re: [LAMP server] - Need help with last part of WordPress install

Fri May 31, 2019 11:51 am

@Andyroo,

I reinstalled and have it working.

I've also installed phpMyAdmin,

But I the following error / warning when logged in

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.
Or alternately go to 'Operations' tab of any database to set it up there.

Configuration of pmadb… not OKDocumentation
General relation features Disabled

Do you know what this means, or how I can fix it?

Thank you!


Andyroo

Re: [LAMP server] - Need help with last part of WordPress install

Fri May 31, 2019 12:12 pm

Looks like the admin tool is not configured correctly in the DB - security settings and possibly (maybe) some tables missing.

This may be due to the previous issues but I'm not sure.

My SQL box is out of action (despite the builder coming again today - I've still got a hole where the wall with the sever should be and will have till Wed at least) so I cannot check the table names to reset the security but DougieLawson has this post viewtopic.php?t=216346#p1330527 that may well be what I come up with.

Try the commands in green (hope you are not colourblind) after logging on to the SQL database with your root user and password.

fbe
Posts: 539
Joined: Thu Aug 17, 2017 9:08 pm

Re: [LAMP server] - Need help with last part of WordPress install

Fri May 31, 2019 6:47 pm

You can't install phpmyadmin if you completed the tutorial, that you mentioned in your first post. You must install it before the

Code: Select all

GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
step. The installation of phpmyadmin fails if root needs a password to login to the database server.

Return to “Networking and servers”