how to find the mysql hostname in terminal(SSH)

If you want to know the port number of your local host on which Mysql is running you can use this query on MySQL Command line client —

SHOW VARIABLES WHERE Variable_name = ‘port’;

mysql> SHOW VARIABLES WHERE Variable_name = ‘port’;

+—————+——-+

| Variable_name | Value |

+—————+——-+

| port          | 3306  |

+—————+——-+

1 row in set (0.00 sec)

It will give you the port number on which MySQL is running.

If you want to know the hostname of your Mysql you can use this query on MySQL Command line client —

SHOW VARIABLES WHERE Variable_name = ‘hostname’;

mysql> SHOW VARIABLES WHERE Variable_name = ‘hostname’;

+——————-+——-+

| Variable_name     | Value |

+——————-+——-+

| hostname          | Dell  |

+——————-+——-+

1 row in set (0.00 sec)

It will give you the hostname for mysql.

If you want to know the username of your Mysql you can use this query on MySQL Command line client —

select user();   

mysql> select user();

+—————-+

| user()         |

+—————-+

| root@localhost |

+—————-+

1 row in set (0.00 sec)

default-username = root password = you-know-it-better url for localhost = jdbc:mysql://localhost default-port = 3306

    For example, you can try:

//If you want to get user, you need start query in your mysql:

SELECT user(); // output your user: root@localhost

SELECT system_user(); // —

//If you want to get port your “mysql://user:pass@hostname:port/db”

SELECT @@port; //3306 is default

//If you want hostname your db, you can execute query

SELECT @@hostname;

mysql> SHOW VARIABLES WHERE Variable_name = ‘hostname’;

+—————+———–+

| Variable_name | Value     |

+—————+———–+

| hostname      | karola-pc |

+—————+———–+

1 row in set (0.00 sec)

Hope it will Help you to understand

To enable gZip in Magento 1.9

Kindly include the following code inside the .htaccess file

 <IfModule mod_headers.c>
# YEAR
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
Header set Cache-Control "max-age=29030400"
</FilesMatch>
# WEEK
<FilesMatch "\.(js|css|swf)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
# 45 MIN
<FilesMatch "\.(html|htm|txt)$">
Header set Cache-Control "max-age=86400"
</FilesMatch>
</IfModule>

<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl|asp|html)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

 

Manually Changing Domain in Magento

How to Manually Change Domain in Magento

  1. Update your core_config_data table to edit the two records for web/unsecure/base_urland web/secure/base_url
  2. Delete the contents of WEBROOT/var/cache
  3. Update / edit any .htaccess domain redirects you may have added
  4. Restart Apache
  5. Make sure Apache has write permissions to WEBROOT/var
  6. If you created a new DB, ensure that the WEBROOT/app/etc/local.xml is pointing to it.
  7. If you’re using Chrome, clear your browser cache! (Chrome caches 301s)

You can remove the index.php in the frontend URLs performing the following steps:

Go to the admin section of Magento.

  1. In System -> Configuration -> Web -> Search Engines Optimizations, select YES.
  2. In System -> Configuration -> Web -> Secure -> Use secure URLs in the frontend, select YES.
  3. Edit the /installdir/apps/magento/htdocs/.htaccess and uncomment the line:

    RewriteBase /magento/

Redirection conditions for contact form 7 in wordpress

I found an answer :  Redirecting without a condition When you use the WordPress plugin “Contact Form 7” you can redirect the user to another page after submitting the answers by the following code:  on_sent_ok: “location.replace(‘http://www.website1.com&#8217;);”

The line of code you have to copy into the “settings” box at the end of a specific form you created.  Redirecting on a condition If you want to make the redirecting depending on a specific answer, you can use the following code:  on_sent_ok: ” if (document.getElementById(‘field’).value==’yes’) {location.replace(‘http://www.website1.com&#8217;)} else { location.replace(‘http://www.website2.com/&#8217;) } “

The code in bold letters has to be changed by your settings.  For example: The question with the id “field” has two possible answers: “Yes” or “No”. If a person selects “Yes” he or she should be redirected to “http://www.website1.com”. If “No” is selected, the user should be redirected to “http://www.website2.com/”.

Magento : Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url

Get Url in phtml files

1. Get Base Url :

Mage::getBaseUrl();

2. Get Skin Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

(a) Unsecure Skin Url :

$this->getSkinUrl('images/imagename.jpg');

(b) Secure Skin Url :

$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));

3. Get Media Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

4. Get Js Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

5. Get Store Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

6. Get Current Url

Mage::helper('core/url')->getCurrentUrl();

Get Url in cms pages or static blocks

1. Get Base Url :

{{store url=""}}

2. Get Skin Url :

{{skin url='images/imagename.jpg'}}

3. Get Media Url :

{{media url='/imagename.jpg'}}

4. Get Store Url :

{{store url='mypage.html'}}
Thanks to http://www.extensionhut.com/blog/