Running MySQL locally after MacOS High Sierra Version 10.13.4 Update - php

Having recently Updated my MacOS to the latest version 10.13.4, my Locally run version of MySQL (Ver 14.14 Distrib 5.7.22, for osx10.13 (x86_64)) would no longer start properly. I get the following error when I try to run it using mysql start: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
And When I try to run it using mysql.server start, sometimes it starts and works for a few seconds, before stopping again.
Other times, I get the following error:
ERROR! The server quit without updating PID file (/usr/local/var/mysql/My-MacBook-Pro.local.pid).
When I navigate to this location /usr/local/var/mysql/My-MacBook-Pro.local.pid, I notice that the .pid file is missing, rather a .err file having the same name exists in it's stead. When I open this file I see that it contains nothing. And when I rename it have the .pid extension, mysql.server start works for a few seconds again, before I observe that the .pid file get changed to a .err file again (I observe this in realtime from a finder window).
Asides from Having to uninstall and reinstall mySQL again, I can't seem to find a practical solution. Last time I did this was around three days ago. And now it's stopped working again.
Could someone explain what seems to be going on?

Related

WP database error Unknown column ‘wp_’ in ‘field list’ for query SELECT wp_

Please do not close this question, it's not a duplicate and the suggested link explaining how to use quotes on MySQL does nothing for me since this problem is inside a WP script. Thanks
I’m trying to install WP 5.4.1 on a clean Windows 2019 Server virtual machine.
I didn’t use Microsoft Web Platform Installer since it download old versions of WP / MySQL and PHP, so I’m trying to install from scratch.
Here are the steps I’ve taken:
Downloaded and Installed latest PHP 7.4.5, non thread safe version
and installed it
renamed php.ini-production to php.ini
Edited php.ini to:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
extesion=mysqli (removed the semicolon here since PHP needs this driver to connect to MySQL8)
In IIS I created the *.php mapping and added default.php and index.php
Created the dummy phpinfo.php file and tested on IIS, all working correctly and phpinfo() shows data
Downloaded MySQL 8.0.20 and installed with the following options:
Server only
Standalone
Server computer
For the authentication method I choose ‘Use Stron password encryption’ as suggested by the PHP installer
added MySQL BIN folder to path environment variable
opened %PROGRAMDATA%\MySQL\MySQL Server 8.0\my.ini and disabled sha2 and enable native_password:
;default_authentication_plugin=caching_sha2_password
default_authentication_plugin=mysql_native_password
created a new database for WP, called wp1 (in MySQL 8, the ‘one liner’ to create the user and grant access at the same time doesn’t work, so we need to do it in 2 lines)
mysql -u root -p
create database wp1;
CREATE USER ‘wp1’#’%’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON wp1.* TO ‘wp1’#’%’;
FLUSH PRIVILEGES;
EXIT
created the folder C:\intepub\wwroot\wp1 and give full access to IUSR and Users windows groups so WP can write the config files
In IIS, right click on the Default Web Site and click on Add Application pointing to the new wp1 folder
navigate to localhost/wp1 to start WP installation
So after selecting the language and entering the DB info, I get this error
WordPress database error Unknown column ‘wp_’ in ‘field list’ for query SELECT wp_
After hours fighting with this, here’s what I found:
the error came from the DB, not WP.
tried with both wp1 and root users during the installation
tried with both localhost and 127.0.0.1 during the installation
the error generates in setup-config.php file, line 315 $wpdb->query("SELECT $prefix")
seems the problem is that what arrives at MySQL is the string select wp_ insted of select 'wp_' (note the missing quotes)
If I go to MySQL and execute select wp_ I get the exact same error
So the issue seems to be related to how MySQL 8.0 is handling quotes in the query it receives from WP installer…
I restored a snapshot just before installing MySQL 8.0.20 and this time, instead of
Use Strong Password Encryption for Authentication
I selected
Use Legacy Authentication Method (Retain MySQL 5.x Compatibility) but the error is still the same
Before answering, please consider:
I’m looking to solve the issue, not to start a discussion whatever I should use MySQL 5.x instead of MySQL 8.x
Yes, the connection to the database is Ok, that’s not the problem, please read all the my post
Yes, wp-config is being written with the correct values
Even tough I saw many messages with this same error on the WP forum, they normally have no answer, or the answer don’t make any sense (like asking to OP to check the DB credentials and write access to the WP folder), still I posted on the WP forum, but I no answer yet.
Sorry for my poor formatting!
Can anyone please help?
Finally found the issue...
TLDR; edit your php.ini and make sure you have both:
display_errors = On
error_log = php_errors.log
Setting error_log solves the issue... I guess that when error_log has no value (default configuration), PHP decides to send the error back to the calling program, resulting in the error message column 'wp_' in 'field list' during the WP installation.
More details here
I just deleted lines 317 to 322 in wp-admin\setup-config.php re-ran the setup and it all worked fine.
Might not be the right solution but the only thing that worked for me.
This was for WP 5.5.3, previous versions I had no issues downloading and installing
This error is possible if WordPress version doesn't support server's PHP version.
In my case I recently installed the latest XAMPP with PHP 8.1.1 and had to downgrade PHP to 8.0.14 in order for WordPress 5.8.2/5.8.3 to be installed and work properly.
I just deleted lines 317 to 322 in wp-admin\setup-config.php re-ran the setup and it all worked fine.
Might not be the right solution but the only thing that worked for me.
This was for WP 5.5.3, previous versions I had no issues downloading and installing
Same for me on version 5.6.2 when trying to install a second site using the same database so needed new table prefix
None of the above solutions is worked for my case. Because I have already installed Mysql workbench on my windows machine. I stopped the already running mysql server, I have followed the below mentioned steps.
Open command prompt, then navigate to the following path
C:\Program Files\MySQL\MySQL Server 8.0\
Then ran the following command
mysqladmin -u root -p shutdown
After that I restarted the apache and mysql on xampp server it is working fine.
I found a solution, for me the problem was in php folder (exactly "php.ini" file), so to get the standard settings I just installed windows server 2019 in VMWare then installed "php 7.4" using web platform, then I copied the PHP folder from VMWare "C:\Program Files (x86)\PHP\v7.4" to my PC (windows10), then I download "wordpress5.8.2", and "mysql8.0.1", after installing mysql and creating DB for wordpress(just create DB) and setup the IIS in my windows10, I ran localhost and every thing working good and wordpress installed without any errors.
So try to get the php.ini that installed with web platform and overwrite it on your php folder and run, if it does not work try to copy the whole php folder and try again, I tried this with php 8.0 but have many errors.

WAMPServer Install - Error on phpMyAdmin login - Error #1193

I'm trying to set up WAMPServer for the first time on my personal computer to do some WordPress work. When I try to log into phpadmin with the root login, I get an error screen. The Error reads as such:
SQL query: Edit
SET lc_messages = 'en_US';
MySQL said:
1193 - Unknown system variable 'lc_messages'
I've tried running PHP version 7.0.10 and 5.6.25 but the errors occurred on both.
I'm running MySQL version 5.7.14
I've tried looking at a StackOverflow forum with the same issue, linked here, but none of the suggested fixes worked for me there, since I'm running a pretty updated version of phpMyAdmin.
The correct name for that parameter is lc-messages note a hyphen and not an underscore.
Have you amended anything in the 'my.ini'?
RE: Your Comment
Then potentially you have another MySQL runing or maybe just a rouge my.ini file on your system.
Search for my.ini and if you find it anywhere other then inside the \wamp\ or \wamp64\ folders, remove or rename it. There should not be one outside the wamp folder structure.
Worked for me
On my system there was another SQL SERVER was running, that was the problem.
Simply go to WAMPMANAGER-> MySQL-> Use a port other than 3306
(In my case, Wamp Manager automatically selected port 3308)
click ok and restart the wamp server.

Mysql - unknown variable 'table_cache=64'

I use Mamp Pro 3. I upgraded Mamp's MySql to 5.6.24 using this script https://gist.github.com/tobi-pb/b9426db51f262d88515c.
After that I ran the Mamp Pro and MySql cannot be started. So I looked the mysql_error.log and found the following error:
2015-06-15 01:24:55 13139 [ERROR] /Applications/MAMP/Library/bin/mysqld: unknown variable 'table_cache=64'
2015-06-15 01:24:55 13139 [ERROR] Aborting
After I google about this error, I get to know that I have to delete 'table_cache=64' variable from my.cnf (MySql Configuration) file. So I deleted this variable from /Applications/MAMP/tmp/mysql/my.cnf file.
But the problem is that the same error still occurs when I start the MySql again. So I looked at the my.cnf file, 'table_cache=64' re-appears automatically again. I deleted it again but it automatically appeared again when I start the MySql.
So how should I solve this 'table_cache=64' problem?
As from MySQL 5.1.3 table_cache changed to table_open_cache. For details see https://dba.stackexchange.com/questions/104025/mysql-unknown-variable-table-cache-64
There may be people who also experience this problem like me. After 3 full days of trying with no success, I gave up to solve this problem with proper way.
I uninstall MAMP Pro 3 and reset Mysql root user's password and then I run my websites with MAMP free version. All the problems gone and Mysql version successfully upgraded.

How to start wamp?

I am unable to start wamp, .pid file deleted from location wamp\bin\mysql\mysql5.5.8\data, because of which unable to connect phpmyadmin, it's showing 2002 error, Please guide about how to start wamp.
The .pid file is recreated each time MySQL starts.
Mine looks like wamp\bin\mysql\mysql5.5.8\data\MACHINE_NAME.pid
Deleting it should not cause MySQL to fail on restart, so there must be another problem. Look at the mysql error log and if that does not tell you anything useful, look at the Windows Event Viewer, MySQL writes to the event viewer even before it tries to open and use its error.log file. There may be something in there that tells you what the problem is.
You can go to the Control Panel of the system and then remove the wamp server after you choose a new wamp server.

Apache2, PHP5, and Interbase/Firebird on Windows 2003/XP

I have recently upgraded from Apache 1.26 and PHP 4.3 to 2.2.11 and 5.2.9 respectively. With my original setup I had a scheduled task set to run every Sunday for a weekly newsletter. It would connect to my database (Interbase/Firebird) to find out what events were opening for the following week and get the list of addresses the email will be sent to. Of course, I had to change how PHP the task was setup since command line execution has changed slightly from version 4 to 5. Once that was fixed the real problem reared it's head.
Now when executing any script from the command line I cannot connect to my database. I receive the following error from ibase_errmsg: Unable to complete network request to host "localhost". Failed to locate host machice. Undefined service gds_db/tcp.
The same script works perfectly from the browser. Also, the database connect code is used all through my site for logging in, getting records, and updating records.
If anyone has any idea why a script will not connect to the database when executed from the command line, please help.
Sorry for the post everyone. I have answered that question. I had to copy my fbclient.dll file in to my PHP folder and rename it gds32.dll.
Does anyone know why I had to do this for executing command line scripts only, and not for scripts that run in the browser?

Categories