• Hi all,

    I am on my third attempt at installing WordPress on a virtual server (Debian8) now, but I keep on running into what I think must be ownership / privileges issues meaning that WordPress cannot update or install plugins (such as WordPress Importer 0.6.1).

    I am working from the shell on my virtual server, logged in through ssl. I am not certain I know precisely what I did on the previous occasions but this time I used wget to download wordpress and expanded it into the website root.

    Having done this, I attempted to follow the tutorial to set up a mysql database. I had previously done this, but this time I ran into several privilege problems eg.:

    ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation

    Unless I was entering mysql as root, which I was aiming to avoid doing so that the database could be run as a standard “mortal” user.

    I am assuming this may be one of the problems, though I don’t recall running into this last time and I still had issues with the install and plug-ins / update etc.

    Ok, so I navigated to the [www.pocketapocketa.cz/]wp-admin/install.php and filled in what I thought was the mysql information. Having done so, I reached a page saying that WordPress could not write the wp-config.php file and asking me to write it in myself. [I had this same step last time.] At this point I navigated back and forth, while changing permissions on the wordpress files to 755.

    -rw-r–r– 1 rozruch rozruch 418 Sep 25 2013 index.php
    -rw-r–r– 1 rozruch rozruch 19930 Jan 1 2015 license.txt
    -rw-r–r– 1 rozruch www-data 1747 Aug 8 18:10 old_index.html
    drwxr-xr-x 29 rozruch www-data 4096 Sep 4 19:19 Radical_transparency
    -rw-r–r– 1 rozruch rozruch 7358 Apr 23 20:00 readme.html
    -rwxr-xr-x 1 rozruch rozruch 4951 Aug 20 2014 wp-activate.php
    drwxr-xr-x 9 rozruch rozruch 4096 Aug 18 20:13 wp-admin
    -rwxr-xr-x 1 rozruch rozruch 271 Jan 8 2012 wp-blog-header.php
    -rwxr-xr-x 1 rozruch rozruch 5007 Jan 8 2015 wp-comments-post.php
    -rwxr-xr-x 1 rozruch rozruch 2764 May 10 02:06 wp-config-sample.php
    drwxr-xr-x 4 rozruch rozruch 4096 Aug 18 20:13 wp-content
    -rwxr-xr-x 1 rozruch rozruch 3286 May 24 19:26 wp-cron.php
    drwxr-xr-x 12 rozruch rozruch 4096 Aug 18 20:13 wp-includes
    -rwxr-xr-x 1 rozruch rozruch 2380 Oct 25 2013 wp-links-opml.php
    -rwxr-xr-x 1 rozruch rozruch 3123 Apr 12 23:29 wp-load.php
    -rwxr-xr-x 1 rozruch rozruch 34669 Jul 29 05:56 wp-login.php
    -rwxr-xr-x 1 rozruch rozruch 8252 Jul 17 2014 wp-mail.php
    -rwxr-xr-x 1 rozruch rozruch 11062 Jun 25 04:29 wp-settings.php
    -rwxr-xr-x 1 rozruch rozruch 25124 Jun 27 03:03 wp-signup.php
    -rwxr-xr-x 1 rozruch rozruch 4035 Nov 30 2014 wp-trackback.php
    -rwxr-xr-x 1 rozruch rozruch 3055 Jul 28 14:17 xmlrpc.php

    I cut and paste the wp-config.php file, complete the install basics, log in and navigate to install the importer plug in. This leads me to the Connection Information FTP page which it seems (according to a number of pages I have found) comes up only when WordPress has insufficient permissions. (I have set up Filezilla to write to my virtual server but must admit I don’t yet understand the settings on this page.)

    I remain a noob and am in no doubt that I am making a noob mistake here, but I have read around on this for a couple of months now, attempted several fresh installs and ‘debugging sessions’ and I am at a loss. I would appreciate any help or suggestions.

    Many thanks,

    Rob

Viewing 10 replies - 1 through 10 (of 10 total)
  • It is permissions, but it’s database permissions, not file permissions.

    You need to create a new MySQL user for the database, and then grant it privilidges over the database that you’re using for WordPress. The normal way that I’ve done that is through phpmyadmin, but I know that there’s easy commands to do it through the comamnd line as well.

    Hi pocket,

    It seems something is wrong on the whole vps setup.

    Just to debug, put you as root user. Use something like:

    $ cat /etc/passwd

    To list current users.

    If your problem is that you can’t access mysql database, then your root don’t have rights to it, try this:

    mysql -u root -p

    Then try again.

    All that done, check if wordpress files have root or equivalent privileges only for the install, same for mysql/database. Don’t forget to check your wp-config.php file too (redirecting to the right mysql database, on the right user, with the right permissions).

    After you thoroughly checked that, logged off root.

    Most installs on Debian/Ubuntu first create a user before install, then make it sudo for all things related wordpress – only for setup of course.

    It’s also possible that you created a linux user (for wordpress) that don’t have rights to read & write the related mysql database.

    Good luck on the debug, you can also check very good tutorials by digitalocean like this one:

    https://www.digitalocean.com/community/tutorials/initial-server-setup-with-debian-8

    Thread Starter pocketapocketa

    (@pocketapocketa)

    Thank you both for your replies. I have had a fair debugging session today. I’m particularly busy at work at the moment, and I’m pretty tired, but nothing so far. I have deleted and re-created the mysql database and, though there were no reported errors this time, WordPress (freshly downloaded and unpacked) is still unable to write wp-config.php and still asks for the FTP connection information.

    Good luck on the debug, you can also check very good tutorials by digitalocean like this one:

    https://www.digitalocean.com/community/tutorials/initial-server-setup-with-debian-8

    Judging by my ssl set-up I followed this one or very similar. I think it may have been this one.

    Use something like:

    $ cat /etc/passwd

    To list current users.

    This lists daemons & special users. Those that strike me as relevant are the following

    […]
    root:x:0:0:root:/root:/bin/bash
    […]
    www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
    mysql:x:109:116:MySQL Server,,,:/nonexistent:/bin/false

    In terms of log in users, there is then the account I use when logging in through ssl. This has sudo privileges.

    Thanks again for your help, I remain at a loss but will keep trying.

    You do know that MySQL users are not the same as system users? You can’t use system user accounts to commect to the MySQL server. You need to create these users in MySQL and then assign their privilidges to each database that you want them to access.

    Your error message:

    ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation

    That’s a MySQL user error – not a system user error.

    Yes, like catacaustic says, seems like your mysql user is not granted access – across your whole setup, please check that.

    Thread Starter pocketapocketa

    (@pocketapocketa)

    Hi guys,

    Sorry for the late reply. Busy with work & ADHD and bla bla so I didn’t get around to looking into this again until now.

    If your problem is that you can’t access mysql database, then your root don’t have rights to it, try this:

    mysql -u root -p

    This seems to have resolved itself. I had not problems setting up databases and users this time…

    You do know that MySQL users are not the same as system users?

    Yes, I do know this, but the *depth* my knowledge of users and privileges is not what it could be, and I think last time I was trying to avoid creating users with the root account of my virtual server in order to avoid the necessity of those databases having to be run as root (if this makes no sense it is because my working assumptions are flawed)… My understanding of how apache or mysql run as a user on my virtual server is patchy at best, and I am struggling to find more information on-line.

    I have once again deleted wordpress and unpacked it, chown-ed to my user rozruch:www-data (they were owned by “nobody” at “nogroup”, I think) and recursively chmod-ed directories to 755, files to 644. WordPress still can’t write the initial wp-config.php file. I can create it and cut and paste and then go on to run the instalation script, but since I have done this every time and then gone on to discover that there is a wider permissions issue, I would sooner try and solve it here.

    I will keep on trying, but I think this may have me beat.

    Thanks again.

    set the permissions as chmod -R 775 for wp folder and check that what is the group set for wp folder , it should be access by apache server.

    Well,

    What version of Linux are you using please?

    I’ll try to come back with a full debrief of things to do with install (2/3 days).

    Thanks,

    Thread Starter pocketapocketa

    (@pocketapocketa)

    Thanks all,

    Sorry I have not had the internet at home and am busy with work and other projects (and I am admittedly rather chaotic as I have ADHD) so I have not been posting as much as I would like here.

    Thank you all for your pointers. Somesh79, I have done what you said. I still get asked for FTP log in upon trying to install the wordpress import plug-in. Am I right in thinking this means WordPress does not have write privileges?

    I am attempting a full rebuild from a fresh Linode image. It is possible I made an early error which I will not have the skills to unpick.

    Digico Paris. I am using Debian 8.

    Thanks all. Getting home internet in the week and hoping to have some time to look over it again today. I appreciate your help ??

    Rob

    Digico Paris

    (@digico-paris)

    Hey Rob,

    If you use a Debian/Ubuntu like Os (same for Linode), you can try a full refresh command like that:

    sudo apt-get update && sudo apt-get upgrade

    If not enough, I’ll suggest you create a new user with write rights on WP folder & subfolders too (chmod 755).

    Digico,

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Privileges issues(?) on install’ is closed to new replies.