Optimize MAMP log locations and MySQL dump commands
1. #################################### old MAMP log locations and dump commands
###############################
/Applications/MAMP/logs/php_error.log
/Applications/MAMP/logs/apache_error_log
/Applications/ MAMP/logs/mysql_error_log.err
Applications/MAMP/tmp/ mysql/my.cnf
/Applications/MAMP/Library/bin/mysql -u root -p root dbname < backup.sql
/Applications/MAMP/Library/bin/mysql_upgrade —password
pop out input: root
################################################################################
#####################
/Applications/MAMP/Library/bin/mysqldump -u root -p -h ip bini > backup.sql
mysqldump -u root -p bini > backup.sql
http://localhost/MAMP/?language=English
################################################################
http://wearepropeople.com/blog/how-to-configure-cybersource-secure-acceptance-
webmobile-in-drupal-7
https://www.drupal.org/project/commerce_cybersource_sawm
centos server
tail -f /var/log/httpd/php_errors_log
tail -f /var/log/httpd/error_log
local
tail -f /var/log/apache2/error_log
tail -f /var/log/php.errors
php.ini
error_log = /var/log/php_errors.log
tail -f /usr/local/var/mysql/media-mac-mini.bh.local.err
after changes in
/etc/my.cnf
#########################################################################
504 time out
cd /etc/httpd/conf
vi httpd.conf
nginx server
504 time out
increase the timeout on the server to 1000,
apachectl start
/sbin/service httpd restart
2. change time out in:
/etc/httpd/conf/httpd.conf
vi httpd.conf
/etc/init.d/httpd reload
# Timeout: The number of seconds before receives and sends time out.
#
##Timeout 120
Timeout 600
#########################################################################
mysql_upgrade -u root -p
aftr import a dumped sql from drush,
seems user and pwd not valid anymore.
root@localhost not permitted anymore
2006 Cannot log in to the MySQL server
sudo /usr/local/Cellar/mysql/5.6.22/bin/mysql.server stop
on cents server
service mysql stop
sudo mysqld_safe --skip-grant-tables
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('root') WHERE User='root';
UPDATE mysql.user SET Password=PASSWORD('yt@jing') WHERE User='jing1';
force https jing.com
then css style will work fine
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.46 sec)
if
mysql> FLUSH PRIVILEGES;
ERROR 1146 (42S02): Table 'mysql.columns_priv' doesn't exist
mysql_upgrade -u root -p
ERROR 1146 (42S02) at line 1135: Table 'mysql.tmp_proxies_priv' doesn't exist
ERROR 1146 (42S02) at line 1136: Table 'mysql.tmp_proxies_priv' doesn't exist
ERROR 1051 (42S02) at line 1137: Unknown table 'tmp_proxies_priv'
mysql> CREATE TABLE `servers` (
-> `Server_name` char(64) NOT NULL,
-> `Host` char(64) NOT NULL,
-> `Db` char(64) NOT NULL,
-> `Username` char(64) NOT NULL,
-> `Password` char(64) NOT NULL,
-> `Port` int(4) DEFAULT NULL,
-> `Socket` char(64) DEFAULT NULL,
3. -> `Wrapper` char(64) NOT NULL,
-> `Owner` char(64) NOT NULL,
-> PRIMARY KEY (`Server_name`)
-> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers
table';
ERROR 1050 (42S01): Table 'servers' already exists
use mysql;
mysql> q
sudo /usr/local/Cellar/mysql/5.6.22/bin/mysql.server start
##############' ERROR! MySQL server PID file could not be
found!'#####################
sent out 89 bytes,
sudo mysql.server stop
make sure no mysql shows up under ps aux
sudo mysql.server start
access denied
ps aux | grep mysql
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
kill -9 1858
one mysql killed, the safe mode also killed
very useful
just try this
sudo mysql.server start
sudo /usr/local/Cellar/mysql/5.6.22/bin/mysql.server restart
sudo /usr/local/Cellar/mysql/5.6.22/bin/mysql.server start
mysqladmin shutdown
close the safe daemon
not working
SHOW VARIABLES LIKE 'max_allowed_packet';
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 104857600 |
+--------------------+-----------+
1 row in set (0.00 sec)
mysql> SET @@global.max_allowed_packet = 16888228;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> SHOW VARIABLES LIKE 'max_allowed_packet';
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 104857600 |
/usr/local/var/mysql/media-mac-mini.bh.local.pid
not guaranteed to work
#create a my.cnf file and add the following (you can use vi: sudo vi /etc/my.cnf
or tools which can edit protected files such as textwrangler:
4. [mysqld]
max_allowed_packet = 64M
# for 2006 can not log in error mysql_pconnect(): send of 5 bytes failed
with errno=32
Broken pipe
wait_timeout=3600
reference: http://www.barebones.com/products/textwrangler/
##############################db Operations
#######################################################
TRUNCATEing all  cache  tables
shift to select the last table starting with cache,
select 'name' from system where filename like 'sites/all%' and status=1
update system SET status = 0 where name like 'uc_% ;
SELECT permission FROM role_permission WHERE rid = 1;
update system SET status = 0 where name like 'uc_% ;
SELECT permission
FROM perm
WHERE role = 1
servers
SELECT permission FROM role_permission WHERE rid = 1;