I can't comment at the moment, but in simple terms, the main focus here should be to fix the mysql password, sudo service mysql stop
,
run the command nano password
to invoke the nano editor, paste the following text substituting with the new password
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
Then save the file (CTRL-X, save the file), now start mysqld with the created file
sudo mysqld --initfile=`pwd`/password
this will reset the mysql password, you may want to run sudo killall mysqld; sudo service mysql start
I'd then suggest using https://help.ubuntu.com/community/WordPress in order to install wordpress. It isn't a production ready environment, but will suffice for testing.
carry on if you actually want a "proper" install;
We are now going to start the installing process. I'm going to assume that you're running ubuntu 14.04, and that you have nothing else on your webserver. (earlier versions will probably be the exact same, however replace /var/www/html with /var/www)
sudo -s
This will run all commands as root, be wary of what you type!
okay, first we need mod_rewrite, apache2 comes bundled with it, however it is disabled by default!
a2enmod rewrite; service apache2 restart;
next,
cd into the web root folder
cd /var/www/html
wget http://wordpress.org/latest.tar.gz
tar -vxaf latest.tar.gz
mv wordpress/* ./
rmdir wordpress
We've just downloaded all of the relevant files required, and moved them into the correct place, next let's allow www-data (the user account for the web-server to modify files)
chown -R www-data:www-data ./
Next, let's allow .htaccess files,
nano /etc/apache2/sites-enabled/000-default.conf
and change the AllowOverride
line to read Allowoverride All
.
you should then be able to login to your webserver and setup the wordpress install.
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
in mySQL I got this output:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u root -p CREATE USER wordpressuser@localhost IDENTIFIED BY 'password'' at line 1
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u root -p CREATE DATABASE wordpress' at line 1