Memory exhausted problem
“Allowed memory size of 134217728 bytes exhausted”
I encountered this problem a few times, and setting memory_limit to a higher value didn’t seem to work
In php.ini:
memory_limit = -1;
Changing www root on WAMP
Open httpd.conf
Change
1 2 | Listen 0.0.0.0:80 Listen [::0]:80 |
to
1 2 | Listen 127.0.0.1:80 Listen [::1]:80 |
Change
1 | DocumentRoot "C:/wamp/www/" |
to
1 | DocumentRoot "C:/Users/name/Sites/localhostwamp/" |
Change
1 2 3 | </pre> <Directory "C:/wamp/www/"> <pre> |
to
1 2 3 | </pre> <Directory "C:/Users/.../Sites/localhostwamp/"> <pre> |
Setting mySQL password
go to shell (right click mysql shell in taskbar)
1 2 | update mysql. user set Password = password ( 'yourPasword' ) where User = 'root' ; flush privileges ; |
go to phpmyadmin directory c:\…\wamp2.5\apps\phpmyadmin4.1.14\config.inc.php
replace:
1 2 3 | $cfg [ 'Servers' ][ $i ][ 'auth_type' ] = 'config' ; $cfg [ 'Servers' ][ $i ][ 'user' ] = 'root' ; $cfg [ 'Servers' ][ $i ][ 'password' ] = '' ; |
with
1 2 3 | $cfg [ 'Servers' ][ $i ][ 'auth_type' ] = 'cookie' ; $cfg [ 'Servers' ][ $i ][ 'user' ] = '' ; $cfg [ 'Servers' ][ $i ][ 'password' ] = '' ; |
Or watch this dummy video tutorial:
Set login session to something less restrictive for testing purposes
in your config.inc.php file (apps/phpmyadmin…)
1 2 | $cfg [ 'LoginCookieValidity' ] = 604800; /* 1 week */ $cfg [ 'MaxNavigationItems' ] = 1000; |
mysql error logging
add these lines to my.ini
1 2 3 4 5 | log-queries-not-using-indexes log-warnings long_query_time = 2 log=C:/Webservers/wamp2/logs/querylog.log log-slow-queries=C:/Webservers/wamp2/logs/SlowQueryLog.log |
import sql-data into mySQL database
Right click Wamp icon in taskbar > mySQL
1 2 3 | show databases; use <databasename>; source c:\ Temp \queries.sql; |
mysqldump in wamp (not via mysql console!)
Go to the wamp mysql directory via cmd prompt
1 | cd c:\Webservers\wamp2\bin\mysql\mysql5.6.17\bin\ |
Now ‘all’ mysql commands are available:
1 | mysqldump -u root -p dbname table1 table2 > output.sql |