Code Is Poetry

Life is Binary

Mysql

Using MySQL from SSH

Using MySQL from SSH may seem to be quite tricky if you’ve never done it before – but fear not – below is a list of MySQL commands that you can use to perform the required actions. Start by logging-in using a SSH client, like PuTTY, to access the shell command line. Below when you see # it means from the unix shell. And when you see mysql> it means from a MySQL prompt after logging into MySQL. To login (from unix shell) use -h hostname only if needed # mysql -h...

Read more

Mysql command line path in windows

Although windows have nice GUI for mysql database management in forms of phpmadmin, sqlyog and may be more, sometimes it is also necessary to have the knowledge of command line usage of mysql.  If wamp is setup, then you can go to mysql command line by following steps 1. type cmd and run windows command line 2. then go to the path of mysql installation folder where it is setup, which might be in following pattern     cd d:\wamp\bin\mysql\mysql_15.1.30\bin (mine is...

Read more

Deleting from large table using LIMIT

Deleting from large table is done using limit. DELETE FROM TABLE_NAME LIMIT 10000; If you need to delete rows of a table based on reference table, You can use condition as well DELETE FROM TABLE_NAME WHERE tbl_field IN ( SELECT tbl_field FROM REF_TABLE_NAME ) LIMIT 10000;

Read more