In mediawiki, Cannot insert pages with bodies longer than the specified value, Why? - mediawiki

I can not put more than 70,000 bytes of text as a body on the page. I took these steps to solve this problem, but it was not successful:
I am sending a page with more than 70k characters to the server and I have checked this from the inspect element that the submitted request is definitely longer than 70k then
1- The end of the request was cut in the first part of the MediaWiki code (index.php) and part of the submitted information was deleted. index.php is the first part of the code that starts processing the request after receiving the request in apache
2- I modified the following variables to php.ini on the Apache server but the problem was not solved
upload_max_filesize = 512M
memory_limit = 1024M
max_execution_time = 100
can you help me?

Check the value of LimitRequestBody Apache setting.
Check the value of post_max_size PHP setting.
A quote from MediaWiki Documentation:
If your Apache server has the Hardened PHP patch, you may need to edit several variables in your /etc/php.ini file if you wish to have wiki pages with large amounts of content. In particular, consider the settings for varfilter.max_value_length, hphp.post.max_value_length, and hphp.request.max_value_length. The default settings may limit your pages to less than 10k or 64k in size.
Another possibility is if your Apache server is using mod_security that could be interfering with mediawiki. You will need to turn it off for mediawiki to work properly
upload_max_filesize is not relevant here.
memory_limit of 1GB is excessive. 128M will usually be enough.

Related

Mysql server uses 500% of cpu

Please let me know what I am doing wrong. As website goes down at every 300 concurrent users.
First step to consider is in your my.cnf [mysqld] section
thread_cache_size=100 # CAP suggested by V8.0 for avoid OOM.
This should be a Dynamic Global Variable that can be set with
SET GLOBAL thread_cache_size=100;
to avoid shutdown/restart.
top looks like ~2000 threads were trying to do something with ~50 running which may drive context switching through the roof.
Also please post your error log for any abnormal shutdown, there are likely clues of the leading cause.

How to Delete MySQL Log File

I am using Windows 7 and My Computer Name is 'COREI5' and have a 1tb Hard Drive.
My Hard Drive is showing as Full but i was not able to Locate which File is so huge to Block the Drive Space.Now Seems i Figured out the File Source.
C:\ProgramData\MySQL\MySQL Server 5.6\data\COREI5-PC-slow
So it seems this 'COREI5-PC-slow' is the culprit file as it is showing a size of aprox 640GB.Note that this filw is shown as a txt file.
My queries are:
1) Will deleting this file harm my computer ? (I am getting error "You Need permission from Computer administrator to make changes")
2) I am not able to delete this file (even after i logged in as administrator)
3) Also Tried to give special permissions but now working
Any Solution ?
Note: I am not much savvy with Such Programs and commands to request you to give details or keep it simple.
I suspect the file is the "slow query" log in the MySQL data directory.
To confirm, connect to MySQL database, and run a query:
SHOW VARIABLES LIKE 'slow%'
Variable_name Value
------------------- --------------------------------------------------------------
slow_launch_time 2
slow_query_log OFF
slow_query_log_file C:\ProgramData\MySQL\MySQL Server\MyLaptop-slow.log
I suspect that in your case, slow_query_log is set to ON. If the filename shown for slow_query_log_file matches the file on your system, you can safely turn off the slow_query_log and then delete the file.
To turn off the slow query log:
SET GLOBAL slow_query_log = 0
Re-run the SHOW VARIABLES LIKE 'slow%' to confirm it's off.
And then you can delete the file from the filesystem. (If you are doing it from the GUI, don't just Delete the file and put it the Recycle Bin. Hold down the shift key when you click Delete, and it will prompt you if you want to "permanently" delete the file.
I'd be concerned that MySQL has logged 640GB worth of slow queries.
That slow_query_launch_time determines the amount of time a query executes before it's considered slow. There also may be a setting that sends all queries that don't use an index into the slow query log, even if it runs faster than slow_query_launch_time.
While you're at it, check that the general log is turned off as well.
SHOW VARIABLES LIKE 'general%'
This question might better be asked on dba.stackexchange.com
For hunting down huge space consumers, I recommend TreeSize Free from JAM Software. An easy to use old-style windows explorer interface, that gives you the total size of directories and files.
My final objective was to delete that file stated above and i was able to achieved the same with help of SHIFT+DELETE and then restart of PC.
It worked - thank you once again.

How to set max_allowed_packet in phpmyadmin?

I have to change max_allowed_packet size in MySQL using phpmyadmin, but I don't know how to do it. When I try set global max_allowed_packet=10M in phpmyadmin it give this error
#1227 - Access denied; you need the SUPER privilege for this operation
I can't get SUPER privilege, because server is not in my control.
So, How can I change it?
You will have to set this in MySQL as well .. Generally found here:
/etc/mysql/my.cnf
Example:
max_allowed_packet = 16M
If the server is not in your control, you are going to have to ask for access to said file.
You cannot.
To change it dynamically, as with the SET you tried, you need the SUPER privilege, there is no way around it. And this is a good thing, because 1. the setting is global, which means it affects all connections, and 2. it might jeopardize the server (it makes it easier to DoS a server, for example).
To set it permanently, you need access to the MySQL configuration file and be able to restart the service, as Zak advises.
The real question is, however, why do you need such a high limit. Unless you are trying to import a large dump, having a need for such a limit almost always suggests something was wrongly designed in the first place. If you are importing a dump, try to import smaller bits at a time.
You can change variables from the "Server variables and settings" page, which is accessible via "Variables" at the top or at [server]/phpmyadmin/server_variables.php
Look up "max_allowed_packet", and hit Edit - default is 4194304 (4MB, in bytes).

Hibernate - save large files

I need to save large files (up to 5Mb) to DB (MySql) via Hibernate.
Changing max_allowed_packet param looks not good idea for me.
Is there a way or hibernate technics to do this? For example automatic breaking data into small portions and insert them one-by-one in 1 transaction.
I believe this should be possible.
Since it is limited at server-side you can't modifiy this on client side, thus you need to increase max_allowed_packet to at least 5MB.
The maximum is 1GB according to them manual. So 5MB shouldn't be too large.

Binary file size

I have added the following option in order to avoid having smaller multiple binary files.
max_binlog_size=1024M
But MySQL still does not create a huge binary file as expected. How do I make it create a single file instead of multiple small files?
MySQL manual says
The server creates a new file in the
series each time it starts or flushes
the logs
So, actually, you cannot control the size of binary log. Server should not start a new file until a log is flushed, server restarted or max_binlog_size reached whatever comes first.
Why do you need such degree of control, BTW?