LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MYSQL - how to tell what's going on ? (WordPress) (https://www.linuxquestions.org/questions/linux-software-2/mysql-how-to-tell-whats-going-on-wordpress-4175601664/)

mogmog 03-13-2017 09:43 AM

MYSQL - how to tell what's going on ? (WordPress)
 
Hi,
I followed a very clear pair of YouTube videos ([url]https://www.youtube.com/watch?v=eNpyEEW6No8[/url and https://www.youtube.com/watch?v=jUduv3_FY3c ]) on installing LAMP and WordPress. Thought I'd got it all right, but appear not to have as WordPress can't access the database.

I've looked up the error, it's quite common, but nothing I've tried works.

I'm not sure what the questions are to ask...

Does MYSQL need to be started explicitly?

Any command run starting MYSQL gets "ERROR 1045 (28000): Access denied for user... "
If I run MYSQLD (is this the server? what's the relationship with this & MYSQL?) I get a whole host of warnings (170313....)

Where do I fing MYSQL on my machine?
How can I tell if I successfully created a database?
Many thanks

mogmog 03-13-2017 09:55 AM

MYSQL / wordpress not connecting
 
It appears that my DB has been successfully created following this tutorial ( https://www.linux.com/learn/introduction-mysql ), I logged in & "use" took me to my database.

Given that the credentials appear correct & the WP config.php file have the correct credentials, what else is stopping the connection?

Is the database located in the wrong place? How can I tell where WP is looking for it? I don't understand the "ABSPATH" entries if they are relevant?

frankbell 03-13-2017 08:52 PM

Have you configured your wp-config.php file correctly/ That's the first place to check.

Rather than going into a long answer, I'm going to suggest that you read a recent LQ blog post of mine. Then you can come back with specific questions.

http://www.linuxquestions.org/questi...h-xammp-37327/

Also, I can recommend WordPress's on line help. It's rather overwhelming, but it is quite well-written.

mogmog 03-14-2017 05:36 AM

Frank,
Thanks for that.
I just installed LAMP, not XAMPP so not sure how similar they are - the locations of the components are different I think.

I have been using the WordPress help inter alia - I have spent a day and a half on this and end up with loads of not-quite-there tutorials/advice (eg from the WP Codex "Upload the WordPress files to the desired location on your web server": on a local machine (localhost) - where is that?) To a neophyte, that doesn't help much.

In your XAMPP thread
Step 1: Copy the website files -if you haven't yet got a website, is this what you unzip from the WP download? Do you copy & rename it to your site name?

Many thanks in anticipation.

mogmog 03-14-2017 07:09 AM

Just found how to uninstall LAMP as I was (& may still be, in a terrible fug with the MYSQL databases) & currently installing XAMPP...

yancek 03-14-2017 08:33 AM

Quote:

Upload the WordPress files to the desired location on your web server": on a local machine (localhost) - where is that?)
If you are using Mint as the first youtube video is, the location is under the /var/www/html directory. If you move your files there, you should be able to access them from your web browser by entering localhost in the browser pointing to the file. I didn't watch the entire video link you posted so I don't know if it explains testing the various steps. Did you do that? That's all explained at the site below and although it is an Ubuntu site, everything in it should work the same on Mint. If you're not using Mint, you need to post which distribution and release you are using. If you can access your db from a terminal as you indicated above, you should be able to do it from the browser. I've not used WordPress so can't help with that.

mogmog 03-14-2017 12:23 PM

Thanks Yancek, that's where I thought they would be, but nothing I have done worked so I began to doubt. I followed the videos to the letter, pausing & rewinding (they are very clear).

I just couldn't resolve it and uninstalled the LAMP stack & installed XAMPP to see if I had better luck. Nope - every single thing I have done has hiccupped or failed completely: XAMPP threw a bucketload of warnings & errors in installation and I don't think it installed correctly (eg I don't get the control panel as far as I can tell).

However, phpmyadmin worked in my browser & I have now managed to get to the "famous 5 minute installation" stage (after 2 1/2 days of pain)

In case it helps any other lost soul, in phpmyadmin, you either enter YOUR OWN password OR use the generated one - even though that is in a different section, it replaces the one you just typed in...

(this resolved my recent grief. Earlier LAMP/mysql problems I have no idea).

I have now managed to install WP but don't feel entirely certain how I got here.

Thanks Frank & Yancek for taking the time to answer - both answers made me scrutinise everything again, which in turn led to success.
Cheers.

frankbell 03-14-2017 09:28 PM

Glad you got it fixed. Congrats.

Habitual 03-15-2017 08:42 AM

Quote:

Originally Posted by mogmog (Post 5683360)
I have now managed to install WP but don't feel entirely certain how I got here.

Same process for new install, or a migration to a new host, or a remote database. Always the same procedure.

The credentials in wp-config.php must be granted access in mysql to make the connection.

eg:
define('DB_NAME')
define('DB_USER')
define('DB_PASSWORD')

Code:

mysql > grant all on DB_NAME.* to DB_USER@'localhost' identified by 'DB_PASSWORD'; flush privileges; exit;
Always the same test:
Creds in wp-config against command-line mysql using
Code:

mysql -uDB_USER -p -e "show databases;"
should show you the Wordpress database, if the credentials are correct in mysql
If not, double check.

Good Luck.

mogmog 03-15-2017 09:48 AM

Hopefully won't have to do this again in a hurry.
 
Habitual, Might come in handy if I need to set up another site.
Thanks.

Habitual 03-15-2017 02:34 PM

https://codex.wordpress.org/Installi...Minute_Install
https://codex.wordpress.org/Hardening_WordPress


All times are GMT -5. The time now is 07:51 PM.