Mysql - unknown variable 'table_cache=64' - php

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.

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.

Running MySQL locally after MacOS High Sierra Version 10.13.4 Update

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?

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.

Apache in MAMP Pro 4 has stopped working, refuses to start

Have been using MAMP Pro for a fair while - version 3 primarily, upgraded to 4 a while ago.
I haven't had any unusual issues at all, but today the Apache service failed to start, telling me to check the error logs. The logs were blank unfortunately... I've made no system configuration changes, no changes to MAMP/MAMP Pro. Shut down my system yesterday, started today, it no longer works...
I've tried numerous suggestions found via Stack Overflow and Google without any success.
Even after completely uninstalling and re-installing MAMP Pro I am unable to get the service to start.
Nothing appears in the logs...
When starting it manually on the command line it comes up with a PHP related error:
$ Applications/MAMP/bin/apache2/bin/apachectl start
httpd: Syntax error on line 135 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so into server: dlopen(/Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, 10): image not found
The confusing thing is that I don't have PHP 5.2.17 specified anywhere, at all - according to MAMP Pro it should be using PHP 7.0.12.
If I add PHP 5.2.17 to MAMP using the appropriate MAMP Pro dialogs, Apache still fails to start via the MAMP Pro interface. I can now start it manually from the command line however, but none of my virtual hosts/etc seem to be loaded.
apachectl -V tells me it's using /Applications/MAMP/conf/apache/httpd.conf, but there is nothing in that file that has any reference to any of the configs generated in /Library/Application Support/appsolute/MAMP PRO/conf
It also looks like hosts entries aren't added to /etc/hosts.
Even if I tell /Applications/MAMP/conf/apache/httpd.conf to do nothing but include /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf (and manually add entries to /etc/hosts) it still doesn't seem to work at all...
I and my colleagues are at a complete loss, especially given it was working yesterday...
Has anyone had any issues like this?
I managed to fix the similar issue you had.
My Apache server was working fine and then following updating to 4.0.6 I experienced similar issues.
There were 2 things I did to fix the issue. I was getting the same error where it couldn't find a php file in 5.2.17. After fixing that by adding 5.2.17 to MAMP I experienced an apache error regarding user permissions.
(22)Invalid argument: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
File > Edit Template > Revert ALL Templates to Default Settings.
Save & restarted the servers and all worked finally and all my hosts had retained as well.
I had previously entered a custom line in my httpd.conf file that for countless versions had copied across fine however it looks like the folder structure had changed and so couldn't locate it causing the unusual error about User permissions. I have since re-entered the custom line with the correct structure and all working fine again.
Hope this helps.

cannot run phpMyAdmin on Windows 10 - session.save_path issue?

I have installed mysql, php5 and apache on windows 10 and I downloaded phpMyAdmin but when I try to open it from localhost/phpmyadmin I get the error message:
Fatal error: Call to undefined function __() in C:\apache24\htdocs\phpmyadmin\libraries\sanitizing.lib.php on line 135
which I don't understand.
In one of other threads I found an information this may be caused by session.save_path being wrongly configured and when I open phpinfo() in the row with this variable there is no value in neither of the columns.
Apache is up and running and php is working and so is mysql. What could be the issue?
Thanks in advance for suggestions.
If you don't get your problem solved, you could try using this program for hosting your website on your localhost. I'm using it all day long and haven't got any problems with that, yet.
https://www.apachefriends.org/de/index.html

Categories