MYSQL

  • WAMP SERVER PORT ISSUE

    AUTHOR: // CATEGORY: Development, Joomla, mySQL, Open Source, PC, Wordpress

    1 Comment

    Okay … So on Windows 7 sometimes after installing WAMP you have an issue starting the WAMP Server. This is caused by port 80 using used by IIS. So to change the Apache port for WAMP complete the following:

    How to change WAMP server port number windows 7

    1. Go to c:\wamp\bin\apache\Apache (your version)\conf
    2. Open httpd.conf file
    3. Search for Listen 80
    4. Change the line “Listen 80” to “Listen 8080” (or Listen You can use any no)
    5. Save the file and close it
    6. Then open http://localhost:8080/ , next to the localhost place the port no you changed in the httpd.conf file

    This solution is really helpful to use both IIS and WAMP server.

    Credits:

    http://atechguide.com/fix-wamp-server-offline/

  • HOW TO GET A SIZE OF COLUMN IN MYSQL

    AUTHOR: // CATEGORY: Development, mySQL, Open Source

    No Comments

    So last week I got an email from our host saying a database has received its maximum size of 3GB. I was like what? How? So I quickly ran the below to check which column was causing the problem.

    If you want to find out the size of column=COLUMN_NAME from table=TABLE_NAME, you can always run a query like this:

    SELECT sum(char_length(COLUMN_NAME))FROM TABLE_NAME;
    
    

    Size returned is in bytes. If you want it in kb, you could just divide it by 1024, like so:

    SELECT sum(char_length(COLUMN_NAME))/1024FROM TABLE_NAME;

    Happy querying.