<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Software Solutions &#187; MySQL</title>
	<atom:link href="http://ossmall.info/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://ossmall.info</link>
	<description>Open Software Solutions</description>
	<lastBuildDate>Wed, 23 May 2012 15:33:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Rename or change name of MySQL table</title>
		<link>http://ossmall.info/rename-or-change-name-of-mysql-table/</link>
		<comments>http://ossmall.info/rename-or-change-name-of-mysql-table/#comments</comments>
		<pubDate>Fri, 11 May 2012 13:28:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/rename-or-change-name-of-mysql-table/</guid>
		<description><![CDATA[This is how to change the name of an existing table tableone to tabletwo : RENAME TABLE  tableone TO tabletwo;  Note : you must issue this command with an user that has the correct priviledges Related Articles or Pages]]></description>
			<content:encoded><![CDATA[<p>This is how to change the name of an existing table<strong> tableone</strong> to <strong>tabletwo</strong><span style="font-weight: bold"></span> :</p>
<p><strong>RENAME TABLE </strong><strong> tableone</strong><strong> TO </strong><strong>tabletwo</strong><strong>;  </strong></p>
<p><strong>Note : </strong>you must issue this command with an user that has the correct priviledges</p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/rename-or-change-name-of-mysql-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Print defaults for the current client connection</title>
		<link>http://ossmall.info/mysql-tricks-print-defaults-for-the-current-client-connection/</link>
		<comments>http://ossmall.info/mysql-tricks-print-defaults-for-the-current-client-connection/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 22:01:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-print-defaults-for-the-current-client-connection/</guid>
		<description><![CDATA[Print defaults for the current client connection $ my_print_defaults client mysql --port=3306 --socket=/tmp/mysql.sock --no-auto-rehash Note, for client connections, you can put setting in the user's .my.cnf file. This file is located in their home directory. ~/.my.cnf Example file that stores the user and password plus ssl settings that will connect to the remote hosts big.squeezel.com. [...]]]></description>
			<content:encoded><![CDATA[<pre> Print defaults for the current client connection

            $ my_print_defaults client mysql
            --port=3306
            --socket=/tmp/mysql.sock
            --no-auto-rehash

     Note, for client connections, you can put setting in
     the user's .my.cnf file. This file is located in their
     home directory.

            ~/.my.cnf

     Example file that stores the user and password plus
             ssl settings that will connect to the remote
             hosts big.squeezel.com.

            [client]
            user=admin
            password=pass32rD
            host=big.squeezel.com
            ssl-ca=/etc/mysql/cacert.pem
            ssl-cert=/etc/mysql/laptopFOO-cert.pem
            ssl-key=/etc/mysql/laptopFOO-key.pem

        Reference tip 38 on setting up ssl connections.</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-print-defaults-for-the-current-client-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL dump import -&gt; Error 1217</title>
		<link>http://ossmall.info/mysql-dump-import-error-1217/</link>
		<comments>http://ossmall.info/mysql-dump-import-error-1217/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 13:19:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-dump-import-error-1217/</guid>
		<description><![CDATA[If you use  innodb tables and foreign key constraints, importing a mysqldump may generate foreign key errors. To resolve this issue please read on : At the beginning of the dump file add this : SET FOREIGN_KEY_CHECKS=0; At the end of the dump file add this : SET FOREIGN_KEY_CHECKS=1; This will disable foreign key checks [...]]]></description>
			<content:encoded><![CDATA[<h4>If you use  innodb tables and foreign key constraints, importing a mysqldump may generate foreign key errors.</h4>
<p>To resolve this issue please read on :</p>
<p>At the beginning of the dump file add this : <strong>SET FOREIGN_KEY_CHECKS=0; </strong></p>
<p>At the end of the dump file add this :<strong> SET FOREIGN_KEY_CHECKS=1; </strong></p>
<ul>
<li>This will disable foreign key checks for the mysqldump import session only.</li>
<li>This will allow the data to be imported without the error being generated.</li>
</ul>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-dump-import-error-1217/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Find out who is doing what, and kill the process if needed.</title>
		<link>http://ossmall.info/mysql-tricks-find-out-who-is-doing-what-and-kill-the-process-if-needed/</link>
		<comments>http://ossmall.info/mysql-tricks-find-out-who-is-doing-what-and-kill-the-process-if-needed/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 21:40:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-find-out-who-is-doing-what-and-kill-the-process-if-needed/</guid>
		<description><![CDATA[Find out who is doing what, and kill the process if needed. This example kills Id 657. mysql&#62; show processlist; show processlist; +-----+------+-----------+---------+---------+-------+-------+------------------+ &#124; Id &#124; User &#124; Host &#124; db &#124; Command &#124; Time &#124; State &#124; Info &#124; +-----+------+-----------+---------+---------+-------+-------+------------------+ &#124; 657 &#124; prog &#124; localhost &#124; weather &#124; Sleep &#124; 28619 &#124; &#124; [...]]]></description>
			<content:encoded><![CDATA[<pre>Find out who is doing what, and kill the process if needed.
    This example kills Id 657.

    mysql&gt; show processlist;
    show processlist;
    +-----+------+-----------+---------+---------+-------+-------+------------------+
    | Id  | User | Host      | db      | Command | Time  | State | Info             |
    +-----+------+-----------+---------+---------+-------+-------+------------------+
    | 657 | prog | localhost | weather | Sleep   | 28619 |       | NULL             |
    | 782 | prog | localhost | weather | Sleep   |   853 |       | NULL             |
    | 785 | prog | localhost | NULL    | Query   |     0 | NULL  | show processlist |
    +-----+------+-----------+---------+---------+-------+-------+------------------+
    3 rows in set (0.00 sec)

    mysql&gt;kill 657

    Or, from the command line, to kill process 782

    [root@third-fl-71 mysql]# mysqladmin processlist
    +-----+------+-----------+---------+---------+------+-------+------------------+
    | Id  | User | Host      | db      | Command | Time | State | Info             |
    +-----+------+-----------+---------+---------+------+-------+------------------+
    | 782 | prog | localhost | weather | Sleep   | 2676 |       |                  |
    | 785 | prog | localhost |         | Sleep   | 1823 |       |                  |
    | 793 | root | localhost |         | Query   | 0    |       | show processlist |
    +-----+------+-----------+---------+---------+------+-------+------------------+
    [root@third-fl-71 mysql]#

    [root@third-fl-71 mysql]# mysqladmin kill 782

    Note, the following can also be helpful

    mysql&gt; show status;
        or
    mysql&gt; show status\G
        also
    mysql&gt; show innodb status;
        or
    mysql&gt; show table status like '%';

        The above gives you create time and other information.</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-find-out-who-is-doing-what-and-kill-the-process-if-needed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete a column from an existing MySQL table</title>
		<link>http://ossmall.info/delete-a-column-from-an-existing-mysql-table/</link>
		<comments>http://ossmall.info/delete-a-column-from-an-existing-mysql-table/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 13:16:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/delete-a-column-from-an-existing-mysql-table/</guid>
		<description><![CDATA[This is how to delete the column my_thing from the table your_table ,  (use the following SQL command: ) ALTER TABLE &#8216;your_table&#8217; DROP &#8216;my_thing&#8217; enjoy Related Articles or Pages]]></description>
			<content:encoded><![CDATA[<p>This is how to delete the column <strong>my_thing</strong> from the table <strong>your_table , </strong> (use the following SQL command: )</p>
<p><strong>ALTER TABLE &#8216;your_table&#8217; DROP &#8216;my_thing&#8217; </strong></p>
<p>enjoy</p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/delete-a-column-from-an-existing-mysql-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increment an exisitng value in Mysql</title>
		<link>http://ossmall.info/increment-an-exisitng-value-in-mysql/</link>
		<comments>http://ossmall.info/increment-an-exisitng-value-in-mysql/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 13:38:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/increment-an-exisitng-value-in-mysql/</guid>
		<description><![CDATA[To increment or decrement and existing number in a table (you do not need to read the value first)  please read on : Increment the value &#8216;timer&#8216; by one for the row in table &#8216;movies&#8216; where &#8216;movie_id&#8216; is &#8217;24&#8242;, use: UPDATE movies SET timer=timer+1 WHERE movie_id=24 Note  to decrement use timer=timer-1 Enjoy Related Articles or [...]]]></description>
			<content:encoded><![CDATA[<p><strong>To increment or decrement and existing number in a table (you do not need to read the value first)  please read on : </strong>Increment the value &#8216;<strong>timer</strong>&#8216; by one for the row in table &#8216;<strong>movies</strong>&#8216; where &#8216;<strong>movie_id</strong>&#8216; is &#8217;24&#8242;, use:</p>
<p><strong>UPDATE </strong><strong>movies</strong><strong> SET </strong><strong>timer</strong><strong>=</strong><strong>timer</strong><strong>+1 WHERE </strong><strong>movie_id</strong><strong>=24</strong></p>
<p><strong>Note</strong>  to decrement use <strong>timer</strong><strong>=</strong><strong>timer</strong><strong>-1</strong></p>
<p>Enjoy</p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/increment-an-exisitng-value-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display a list of databases on a MySQL server</title>
		<link>http://ossmall.info/display-a-list-of-databases-on-a-mysql-server/</link>
		<comments>http://ossmall.info/display-a-list-of-databases-on-a-mysql-server/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 13:00:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/display-a-list-of-databases-on-a-mysql-server/</guid>
		<description><![CDATA[This is how to list the databases that exist in a MySQL server, use the &#8216;show databases&#8216; SQL command: show databases; +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ &#124; Database                &#124; +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ &#124; database1              &#124; &#124; mysql                     &#124; &#124; test                    [...]]]></description>
			<content:encoded><![CDATA[<p>This is how to list the databases that exist in a MySQL server, use the &#8216;<strong>show databases</strong>&#8216; SQL command:</p>
<p><strong>show databases;</strong><br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| Database                |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| database1              |<br />
| mysql                     |<br />
| test                         |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+</p>
<p>It will display all the databases your user has access to</p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/display-a-list-of-databases-on-a-mysql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change max_allowed_packet setting fast</title>
		<link>http://ossmall.info/change-max_allowed_packet-setting-fast/</link>
		<comments>http://ossmall.info/change-max_allowed_packet-setting-fast/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 04:13:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/change-max_allowed_packet-setting-fast/</guid>
		<description><![CDATA[If you want to change the  max_allowed_packet fast, without modifying any confis or restart mysql ? Follow this howto : mysql&#62; show variables like &#8216;max%&#8217; ; +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+ &#124; Variable_name &#124; Value &#124; +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+ &#124; max_allowed_packet &#124; 1048576 &#124; &#8230; mysql&#62; set max_allowed_packet = 1500000; Query OK, 0 rows affected (0.03 sec) mysql&#62; show variables like [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to change the  max_allowed_packet fast, without modifying any confis or restart mysql ?</p>
<p>Follow this howto :</p>
<p>mysql&gt; show variables like &#8216;max%&#8217; ;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+</p>
<p>|<em> Variable_name         | Value      |</em></p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+</p>
<p>|<em> max_allowed_packet    | 1048576    |</em></p>
<p>&#8230;<br />
mysql&gt; set max_allowed_packet = 1500000;</p>
<p>Query OK, 0 rows affected (0.03 sec)<br />
mysql&gt; show variables like &#8216;max%&#8217; ;</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+</p>
<p>|<em> Variable_name         | Value      |</em></p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+</p>
<p>|<em> max_allowed_packet    | 1499136    |</em></p>
<p>This will change max_allowed_packet  but do not restart mysql or the change will reset</p>
<p>This is a temporary trick .</p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/change-max_allowed_packet-setting-fast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : error 1016</title>
		<link>http://ossmall.info/mysql-tricks-error-1016/</link>
		<comments>http://ossmall.info/mysql-tricks-error-1016/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 23:07:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-error-1016/</guid>
		<description><![CDATA["error: 1016: Can't open file:" If it's from an orphaned file, not in the database but on disk, then, the disk file may need to be deleted. myisamchk can help with damaged files. It's best to stop the database. # su - # mysqladmin shutdown # cd /usr/local/var/database # myisamchk * # /etc/init.d/mysql restart Related [...]]]></description>
			<content:encoded><![CDATA[<pre>  "error: 1016: Can't open file:" If it's from an orphaned file, not in the database
     but on disk, then, the disk file may need to be deleted.

     myisamchk can help with damaged files.  It's best to stop the database.

         # su -
         # mysqladmin shutdown

         # cd /usr/local/var/database
         # myisamchk *

         # /etc/init.d/mysql restart</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-error-1016/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drop or delete a table in MySQL</title>
		<link>http://ossmall.info/drop-or-delete-a-table-in-mysql/</link>
		<comments>http://ossmall.info/drop-or-delete-a-table-in-mysql/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 14:03:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/drop-or-delete-a-table-in-mysql/</guid>
		<description><![CDATA[This is how to remove a table from a MySQL database, and remove all of its data, use the following SQL command: 1.  log in mysql 2.  issue command : use yourdatabase;  3. issue command : drop table if exists yourtable; The last command will delete the database if it exists , it is usefull [...]]]></description>
			<content:encoded><![CDATA[<p>This is how to remove a table from a MySQL database, and remove all of its data, use the following SQL command:</p>
<p>1.  log in mysql</p>
<p>2.  issue command : <strong>use yourdatabase; </strong></p>
<p>3. issue command :<strong> drop table if exists yourtable; </strong></p>
<p>The last command will delete the database if it exists , it is usefull because if it does not exist it will not output any error</p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/drop-or-delete-a-table-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Clean up binary log files</title>
		<link>http://ossmall.info/mysql-tricks-clean-up-binary-log-files/</link>
		<comments>http://ossmall.info/mysql-tricks-clean-up-binary-log-files/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 22:43:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-clean-up-binary-log-files/</guid>
		<description><![CDATA[Clean up binary log files. For a default install they may be in /usr/local/var/ or /var/lib/mysql/ with names ending in -bin.000001,-bin.000002,.. The following command may help find out where the logs are located. mysql&#62; show variables like '%home%'; +---------------------------+-----------------+ &#124; Variable_name &#124; Value &#124; +---------------------------+-----------------+ &#124; bdb_home &#124; /var/lib/mysql/ &#124; &#124; innodb_data_home_dir &#124; &#124; &#124; [...]]]></description>
			<content:encoded><![CDATA[<pre>Clean up binary log files.  For a default install they may be in

          /usr/local/var/
       or
          /var/lib/mysql/

    with names ending in -bin.000001,-bin.000002,..  The following
    command may help find out where the logs are located.

         mysql&gt; show variables like '%home%';
         +---------------------------+-----------------+
         | Variable_name             | Value           |
         +---------------------------+-----------------+
         | bdb_home                  | /var/lib/mysql/ |
         | innodb_data_home_dir      |                 |
         | innodb_log_group_home_dir | ./              |
         +---------------------------+-----------------+

    mysql&gt; reset master;
    reset master;
    Query OK, 0 rows affected (0.02 sec)

    See (Tip 24:) details working with binary log files and (Tip 25:) explains
    how to setup logging. (Tip 37:) shows have to setup MASTER and SLAVE
    replication.</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-clean-up-binary-log-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Replace Function</title>
		<link>http://ossmall.info/mysql-replace-function/</link>
		<comments>http://ossmall.info/mysql-replace-function/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 05:52:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[replace]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-replace-function/</guid>
		<description><![CDATA[MySQL Replace(), here&#8217;s the syntax. update [table_name] set [field_name] = replace([field_name],&#8217;[string_to_find]&#8216;,&#8217;[string_to_replace]&#8216;); Related Articles or Pages]]></description>
			<content:encoded><![CDATA[<p>MySQL Replace(), here&#8217;s the syntax.</p>
<p><strong>update [table_name] set [field_name] = replace([field_name],&#8217;[string_to_find]&#8216;,&#8217;[string_to_replace]&#8216;);</strong></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-replace-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : MERGE:  Several tables can be merged into one</title>
		<link>http://ossmall.info/mysql-tricks-merge-several-tables-can-be-merged-into-one/</link>
		<comments>http://ossmall.info/mysql-tricks-merge-several-tables-can-be-merged-into-one/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 21:49:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-merge-several-tables-can-be-merged-into-one/</guid>
		<description><![CDATA[MERGE: Several tables can be merged into one. CREATE TABLE log_01 ( pkey int(11) NOT NULL auto_increment, a int, b varchar(12), timeEnter timestamp(14), PRIMARY KEY (pkey) ) type=MyISAM; CREATE TABLE log_02 ( pkey int(11) NOT NULL auto_increment, a int, b varchar(12), timeEnter timestamp(14), PRIMARY KEY (pkey) ) type=MyISAM; CREATE TABLE log_summary ( pkey int(11) NOT [...]]]></description>
			<content:encoded><![CDATA[<pre>MERGE:  Several tables can be merged into one.

        CREATE TABLE log_01 (
           pkey int(11) NOT NULL auto_increment,
           a int,
           b varchar(12),
           timeEnter timestamp(14),
           PRIMARY KEY  (pkey)
         ) type=MyISAM;

        CREATE TABLE log_02 (
           pkey int(11) NOT NULL auto_increment,
           a int,
           b varchar(12),
           timeEnter timestamp(14),
           PRIMARY KEY  (pkey)
         ) type=MyISAM;

        CREATE TABLE log_summary (
           pkey int(11) NOT NULL auto_increment,
           a int,
           b varchar(12),
           timeEnter timestamp(14),
           PRIMARY KEY  (pkey)
         ) type=MERGE UNION(log_01,log_02) INSERT_METHOD=LAST;

         mysql&gt; insert into log_01 (a,b) values (1,'log1');
         mysql&gt; insert into log_02 (a,b) values (1,'log2');

         mysql&gt; select * from log_summary;
         select * from log_summary;
         +------+------+------+---------------------+
         | pkey | a    | b    | timeEnter           |
         +------+------+------+---------------------+
         |    1 |    1 | log1 | 2004-04-16 11:59:55 |
         |    1 |    1 | log2 | 2004-04-16 12:00:08 |
         +------+------+------+---------------------+
         2 rows in set (0.00 sec)

         Reference:
        <a href="http://dev.mysql.com/doc/mysql/en/MERGE.html" target="_blank"> http://dev.mysql.com/doc/mysql/en/MERGE.html</a></pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-merge-several-tables-can-be-merged-into-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a basic MySQL table</title>
		<link>http://ossmall.info/create-a-basic-mysql-table/</link>
		<comments>http://ossmall.info/create-a-basic-mysql-table/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 13:08:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/create-a-basic-mysql-table/</guid>
		<description><![CDATA[Creating tables in databases is the  first step to store your data To create a table you must describe the columns and their atributes. We will create a table to hold contact information with four columns: contact_id, name, email, and birthdate. contact_id column =  integer number that is 20 decimal places long ( it is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Creating tables in databases is the  first step to store your data</strong></p>
<p>To create a table you must describe the columns and their atributes. We will create a table to hold contact information with four columns: contact_id, name, email, and birthdate.<br />
<strong>contact_id column</strong> =  integer number that is 20 decimal places long ( it is created with an INT(20) datatype).<br />
<strong>name</strong> column holds the full name of a contact, which we  will will set be no longer than 50 characters long, so the datatype is VARCHAR(50).<br />
<strong>birthdate</strong> will be stored as a DATE datatype.</p>
<p>The following SQL command will create a table called <span style="font-weight: bold">mycontact</span> as described above:</p>
<p><strong>CREATE TABLE </strong><span style="font-weight: bold">mycontact</span><strong> (<br />
contact_id INT(20),<br />
name VARCHAR(50),<br />
birthdate DATE,<br />
); </strong></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/create-a-basic-mysql-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Transactions</title>
		<link>http://ossmall.info/mysql-tricks-transactions/</link>
		<comments>http://ossmall.info/mysql-tricks-transactions/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 21:48:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-transactions/</guid>
		<description><![CDATA[Transactions: Not all table types support transactions. BDB and INNODB type do support transactions. Assuming the server has NOT been started with --skip-bdb or --skip-innodb the following should work: mysql&#62; create table tran_test (a int, b int) type = InnoDB; mysql&#62; begin; mysql&#62; insert into tran_test (a,b) values (1,2); mysql&#62; select * from tran_test; select [...]]]></description>
			<content:encoded><![CDATA[<pre>Transactions: Not all table types support transactions. BDB and INNODB type do support transactions.
     Assuming the server has NOT been started with --skip-bdb or --skip-innodb the following should work:

          mysql&gt; create table tran_test (a int, b int) type = InnoDB;
          mysql&gt; begin;
          mysql&gt; insert into tran_test (a,b) values (1,2);

          mysql&gt; select * from tran_test;
          select * from tran_test;
          +------+------+
          | a    | b    |
          +------+------+
          |    1 |    2 |
          +------+------+
          1 row in set (0.00 sec)

          mysql&gt; rollback;

          mysql&gt; select * from tran_test;
          select * from tran_test;
          Empty set (0.00 sec)

     Summary: rollback undoes everything and commit will save.</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import CSV file directly into MySQL</title>
		<link>http://ossmall.info/import-csv-file-directly-into-mysql/</link>
		<comments>http://ossmall.info/import-csv-file-directly-into-mysql/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 11:45:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/import-csv-file-directly-into-mysql/</guid>
		<description><![CDATA[You can use mysql to import directly a csv file . You do not need to make a script to do this anymore From an Excel file , you need to export it as CSV ,  Remove the CSV Headers and the Excel data  from the file ,  and after that it can be inserted [...]]]></description>
			<content:encoded><![CDATA[<p>You can use mysql to import directly a csv file . You do not need to make a script to do this anymore</p>
<p>From an Excel file , you need to export it as CSV ,  Remove the CSV Headers and the Excel data  from the file ,  and after that it can be inserted in MySql</p>
<p>Here is an example :</p>
<p><strong>load data local infile &#8216;your.csv&#8217; into table tblUniq<br />
fields terminated by &#8216;,&#8217;<br />
enclosed by &#8216;&#8221;&#8216;<br />
lines terminated by &#8216;\n&#8217;<br />
(yourName, yourCity, yourComments) </strong></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/import-csv-file-directly-into-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Can the order of the columns in a create statement make a difference?</title>
		<link>http://ossmall.info/mysql-tricks-can-the-order-of-the-columns-in-a-create-statement-make-a-difference/</link>
		<comments>http://ossmall.info/mysql-tricks-can-the-order-of-the-columns-in-a-create-statement-make-a-difference/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 21:45:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-can-the-order-of-the-columns-in-a-create-statement-make-a-difference/</guid>
		<description><![CDATA[Can the order of the columns in a create statement make a difference? YES create table t ( a int, b int, timeUpdate timestamp, timeEnter timestamp ); The first timestamp will always be the "automatically generated" time. So if the record is updated, or inserted, this time gets changed. If the order is changed, "timeEnter" [...]]]></description>
			<content:encoded><![CDATA[<pre>Can the order of the columns in a create statement make a difference? YES

       create table t (
          a int,
          b int,
          timeUpdate timestamp,
          timeEnter timestamp );

    The first timestamp will always be the "automatically generated" time. So
    if the record is updated, or inserted, this time gets changed. If the
    order is changed, "timeEnter" is before "timeUpdate", then,  "timeEnter"
    would get updated.  First timestamp column updates automatically.

    Note, in the table above timeEnter will only get updated if passed a null
    value.

         insert into t (a,b,timeEnter) values (1,2,NULL);

    Hints: Need mm-dd-yyyy hh:mm:ss format?

      select a,b,DATE_FORMAT(timeUpdate,'%m-%d-%Y %T'),DATE_FORMAT(timeEnter,'%m-%d-%Y %T') from t;
      +------+------+---------------------------------------+--------------------------------------+
      | a    | b    | DATE_FORMAT(timeUpdate,'%m-%d-%Y %T') | DATE_FORMAT(timeEnter,'%m-%d-%Y %T') |
      +------+------+---------------------------------------+--------------------------------------+
      |    3 |    2 | 04-15-2004 19:14:36                   | 04-15-2004 19:15:07                  |
      |    3 |    2 | 04-15-2004 19:14:39                   | 04-15-2004 19:15:07                  |
      |    5 |    5 | 00-00-0000 00:00:00                   | 04-15-2004 19:15:53                  |
      |    1 |    2 | 00-00-0000 00:00:00                   | 04-15-2004 19:20:15                  |
      +------+------+---------------------------------------+--------------------------------------+
      4 rows in set (0.00 sec)</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-can-the-order-of-the-columns-in-a-create-statement-make-a-difference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Quick Status</title>
		<link>http://ossmall.info/mysql-tricks-quick-status/</link>
		<comments>http://ossmall.info/mysql-tricks-quick-status/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 22:02:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-quick-status/</guid>
		<description><![CDATA[Quick Status: mysql&#62; \s -------------- /usr/local/bin/mysql Ver 14.3 Distrib 4.1.1-alpha, for pc-linux (i686) Connection id: 642 Current database: Current user: prog@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 4.1.1-alpha-log Protocol version: 10 Connection: Localhost via UNIX socket Client characterset: latin1_swedish_ci Server characterset: latin1_swedish_ci UNIX socket: /tmp/mysql.sock Uptime: [...]]]></description>
			<content:encoded><![CDATA[<pre>Quick Status:

     mysql&gt; \s
     --------------
     /usr/local/bin/mysql  Ver 14.3 Distrib 4.1.1-alpha, for pc-linux (i686)

     Connection id:          642
     Current database:
     Current user:           prog@localhost
     SSL:                    Not in use
     Current pager:          stdout
     Using outfile:          ''
     Using delimiter:        ;
     Server version:         4.1.1-alpha-log
     Protocol version:       10
     Connection:             Localhost via UNIX socket
     Client characterset:    latin1_swedish_ci
     Server characterset:    latin1_swedish_ci
     UNIX socket:            /tmp/mysql.sock
     Uptime:                 1 day 15 hours 24 min 38 sec

     Threads: 1  Questions: 4896  Slow queries: 0
     Opens: 14  Flush tables: 1  Open tables: 8  Queries per second avg: 0.035
     --------------</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-quick-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Remove duplicate entries</title>
		<link>http://ossmall.info/mysql-tricks-remove-duplicate-entries/</link>
		<comments>http://ossmall.info/mysql-tricks-remove-duplicate-entries/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 21:46:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-remove-duplicate-entries/</guid>
		<description><![CDATA[Remove duplicate entries. Assume the following table and data. CREATE TABLE IF NOT EXISTS dupTest ( pkey int(11) NOT NULL auto_increment, a int, b int, c int, timeEnter timestamp(14), PRIMARY KEY (pkey) ); insert into dupTest (a,b,c) values (1,2,3),(1,2,3), (1,5,4),(1,6,4); mysql&#62; select * from dupTest; select * from dupTest; +------+------+------+------+---------------------+ &#124; pkey &#124; a &#124; [...]]]></description>
			<content:encoded><![CDATA[<pre>Remove duplicate entries.  Assume the following table and data.

              CREATE TABLE IF NOT EXISTS dupTest (
                pkey int(11) NOT NULL auto_increment,
                a int,
                b int,
                c int,
                timeEnter timestamp(14),
               PRIMARY KEY  (pkey)

               );

               insert into dupTest (a,b,c) values (1,2,3),(1,2,3),
                  (1,5,4),(1,6,4);

       mysql&gt; select * from dupTest;
       select * from dupTest;
       +------+------+------+------+---------------------+
       | pkey | a    | b    | c    | timeEnter           |
       +------+------+------+------+---------------------+
       |    1 |    1 |    2 |    3 | 2004-04-16 10:55:35 |
       |    2 |    1 |    2 |    3 | 2004-04-16 10:55:35 |
       |    3 |    1 |    5 |    4 | 2004-04-16 10:55:35 |
       |    4 |    1 |    6 |    4 | 2004-04-16 10:55:35 |
       +------+------+------+------+---------------------+
       4 rows in set (0.00 sec)

       mysql&gt;

       Note, the first two rows contains duplicates in columns a and b. It contains
       other duplicates; but, leaves the other duplicates alone.

          mysql&gt; ALTER IGNORE TABLE  dupTest ADD UNIQUE INDEX(a,b);

          mysql&gt; select * from dupTest;
          select * from dupTest;
          +------+------+------+------+---------------------+
          | pkey | a    | b    | c    | timeEnter           |
          +------+------+------+------+---------------------+
          |    1 |    1 |    2 |    3 | 2004-04-16 11:11:42 |
          |    3 |    1 |    5 |    4 | 2004-04-16 11:11:42 |
          |    4 |    1 |    6 |    4 | 2004-04-16 11:11:42 |
          +------+------+------+------+---------------------+
          3 rows in set (0.00 sec)</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-remove-duplicate-entries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show or list tables in a MySQL database</title>
		<link>http://ossmall.info/show-or-list-tables-in-a-mysql-database/</link>
		<comments>http://ossmall.info/show-or-list-tables-in-a-mysql-database/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 13:25:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/show-or-list-tables-in-a-mysql-database/</guid>
		<description><![CDATA[First step is to select a database , after that you can view the tables  1 . view all of the tables in the selected database : SHOW TABLES; 2.  view all of the tables in a different database (not selected): SHOW TABLES IN different_db; 3.  view a specific table in the selected  database : [...]]]></description>
			<content:encoded><![CDATA[<p><strong>First step is to select a database , after that you can view the tables </strong></p>
<p>1 . view all of the tables in the selected database :</p>
<p><strong>SHOW TABLES; </strong></p>
<p>2.  view all of the tables in a different database (not selected):</p>
<p><strong>SHOW TABLES IN different_db; </strong></p>
<p>3.  view a specific table in the selected  database :</p>
<p><strong>SHOW TABLES IN newDB LIKE &#8216;%time&#8217;;</strong></p>
<p>The above command will find all tables that end in &#8220;time&#8221;  from the database <strong>newDB</strong></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/show-or-list-tables-in-a-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Tricks : Show status information on a table</title>
		<link>http://ossmall.info/mysql-tricks-show-status-information-on-a-table/</link>
		<comments>http://ossmall.info/mysql-tricks-show-status-information-on-a-table/#comments</comments>
		<pubDate>Mon, 16 May 2011 21:47:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-tricks-show-status-information-on-a-table/</guid>
		<description><![CDATA[Show status information on a table. Note, if the database was started with --safe-show-database or --skip-show-database some of these commands may not work. Note the "\G" option may provide a nicer format. Show the create statement: mysql&#62; show create table dupTest\G show create table dupTest\G *************************** 1. row *************************** Table: dupTest Create Table: CREATE TABLE [...]]]></description>
			<content:encoded><![CDATA[<pre>Show status information on a table. Note, if the database was started
     with --safe-show-database or --skip-show-database some of these commands
     may not work. Note the "\G" option may provide a nicer format.

     Show the create statement:

               mysql&gt; show create table dupTest\G
               show create table dupTest\G
               *************************** 1. row ***************************
                      Table: dupTest
               Create Table: CREATE TABLE `dupTest` (
                 `pkey` int(11) NOT NULL auto_increment,
                 `a` int(11) default NULL,
                 `b` int(11) default NULL,
                 `c` int(11) default NULL,
                 `timeEnter` timestamp NOT NULL,
                 PRIMARY KEY  (`pkey`),
                 UNIQUE KEY `a` (`a`,`b`)
               ) TYPE=MyISAM DEFAULT CHARSET=latin1
               1 row in set (0.00 sec)</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-tricks-show-status-information-on-a-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dump Content using mysqldump</title>
		<link>http://ossmall.info/dump-content-using-mysqldump/</link>
		<comments>http://ossmall.info/dump-content-using-mysqldump/#comments</comments>
		<pubDate>Sun, 01 May 2011 23:30:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/dump-content-using-mysqldump/</guid>
		<description><![CDATA[You do not need to enter mysql for this , here is the exact sintax you must use : mysqldump -u [username] -p [database_name] &#62; /path/to/file.sql  example mysqldump -u mario  -p marioDB &#62; /tmp/marioDB.sql Related Articles or Pages]]></description>
			<content:encoded><![CDATA[<p>You do not need to enter mysql for this , here is the exact sintax you must use :</p>
<p><strong>mysqldump -u [username] -p [database_name] &gt; /path/to/file.sql  </strong></p>
<p>example</p>
<p><strong>mysqldump -u mario  -p marioDB &gt; /tmp/marioDB.sql</strong></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/dump-content-using-mysqldump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering / Changing Your MySQL Root Password</title>
		<link>http://ossmall.info/recovering-changing-your-mysql-root-password/</link>
		<comments>http://ossmall.info/recovering-changing-your-mysql-root-password/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 21:32:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/recovering-changing-your-mysql-root-password/</guid>
		<description><![CDATA[Recovering / Changing Your MySQL Root Password Sometimes you may have to recover the MySQL root password because it was either forgotten or misplaced. The steps you need are: 1) Stop MySQL [root@bigboy tmp]# service mysqld stop Stopping MySQL:  [  OK  ] [root@bigboy tmp]# 2) Start MySQL in Safe mode with the mysqld_safe command and [...]]]></description>
			<content:encoded><![CDATA[<h3>Recovering / Changing Your MySQL Root Password</h3>
<p>Sometimes you may have to recover the MySQL root password because it was either forgotten or misplaced. The steps you need are:</p>
<p>1) Stop MySQL</p>
<pre>[root@bigboy tmp]# service mysqld stop</pre>
<pre>Stopping MySQL:  [  OK  ]</pre>
<pre>[root@bigboy tmp]#</pre>
<p>2) Start MySQL in Safe mode with the mysqld_safe command and tell it not to read the grant tables with all the MySQL database passwords.</p>
<pre>[root@bigboy tmp]# mysqld_safe --skip-grant-tables --skip-networking &amp;</pre>
<pre>[1] 13007</pre>
<pre>[root@bigboy tmp]# Starting mysqld daemon with databases from /var/lib/mysql</pre>
<pre>[root@bigboy tmp]#</pre>
<p><strong>Note:</strong> In Fedora Core 3 and earlier the mysqld_safe command was named safe_mysqld and the general procedure for password recovery was different.</p>
<p>3) MySQL is now running without password protection. You now have to use the familiar mysql -u root command to get the mysql&gt; command prompt. ( -p flag is not required) As expected, you will not be prompted for a password.</p>
<pre>[root@bigboy tmp]# mysql -u root</pre>
<pre>Welcome to the MySQL monitor.  Commands end with ; or \g.</pre>
<pre>Your MySQL connection id is 1 to server version: 4.1.16</pre>
<pre></pre>
<pre>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.</pre>
<pre></pre>
<pre>mysql&gt;</pre>
<p>4) You will now have to use the mysql database which contains the passwords for all the databases on your system and modify the root password. In this case we are setting it to ack33nsaltf1sh.</p>
<pre>mysql&gt; use mysql;</pre>
<pre>Reading table information for completion of table and column names</pre>
<pre>You can turn off this feature to get a quicker startup with -A</pre>
<pre></pre>
<pre>Database changed</pre>
<pre>mysql&gt; UPDATE user SET Password=PASSWORD("ack33nsaltf1sh") WHERE User="root";</pre>
<pre>Query OK, 1 row affected (0.00 sec)</pre>
<pre>Rows matched: 2  Changed: 1  Warnings: 0</pre>
<pre></pre>
<pre>mysql&gt;</pre>
<p>5) Exit MySQL and restart the mysqld daemon.</p>
<pre>mysql&gt; exit</pre>
<pre>Bye</pre>
<pre>[root@bigboy tmp]# service mysqld restart</pre>
<pre>STOPPING server from pid file /var/run/mysqld/mysqld.pid</pre>
<pre>051224 17:24:56  mysqld ended</pre>
<pre></pre>
<pre>Stopping MySQL:  [  OK  ]</pre>
<pre>Starting MySQL:  [  OK  ]</pre>
<pre>[1]+  Done                    mysqld_safe --skip-grant-tables --skip-networking</pre>
<pre>[root@bigboy tmp]#</pre>
<p>The MySQL root user will now be able to manage MySQL using this new password.</p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/recovering-changing-your-mysql-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation: configured for encryption, C API, and user defined functions.</title>
		<link>http://ossmall.info/installation-configured-for-encryption-c-api-and-user-defined-functions/</link>
		<comments>http://ossmall.info/installation-configured-for-encryption-c-api-and-user-defined-functions/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 20:45:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/installation-configured-for-encryption-c-api-and-user-defined-functions/</guid>
		<description><![CDATA[Installation: configured for encryption, C API, and user defined functions. ./configure --with-openssl --enable-thread-safe-client --with-mysqld-ldflags=-rdynamic The --with-openssl is very helpful for creating your own password file. Also, if doing C API, having thread safe calls "could" come in handly...it's what I use. See (TIP 27) for user defined functions. Complete Steps: shell&#62; groupadd mysql shell&#62; useradd [...]]]></description>
			<content:encoded><![CDATA[<pre>   Installation: configured for encryption, C API, and user defined functions.

        ./configure --with-openssl --enable-thread-safe-client --with-mysqld-ldflags=-rdynamic

     The --with-openssl is very helpful for creating your own
     password file.  Also, if doing C API, having thread safe
     calls "could" come in handly...it's what I use.

     See (TIP 27) for user defined functions.

     Complete Steps:

     shell&gt; groupadd mysql
     shell&gt; useradd -g mysql mysql
     shell&gt; cd mysql-VERSION
     shell&gt; ./configure --with-openssl --enable-thread-safe-client --with-mysqld-ldflags=-rdynamic
     shell&gt; make
     shell&gt; make install
     shell&gt; cp support-files/my-medium.cnf /etc/my.cnf
     shell&gt; cd /usr/local/mysql
     shell&gt; bin/mysql_install_db --user=mysql
     shell&gt; chown -R root  .
     shell&gt; chown -R mysql var
     shell&gt; chgrp -R mysql .
     shell&gt; bin/mysqld_safe --user=mysql &amp;

     See (TIP 25) for configuring the log-bin and log files in /etc/my.cnf

     Installing mysql so that it will startup automatically.
     This also enables it to be restarted, "/etc/init/mysql restart".

	 cp ./support-files/mysql.server /etc/init.d/mysql
	 cd /etc/rc3.d
	 ln -s ../init.d/mysql S85mysql
	 ln -s ../init.d/mysql K85mysql
	 cd /etc/rc5.d
	 ln -s ../init.d/mysql S85mysql
	 ln -s ../init.d/mysql K85mysql
	 cd ../init.d
	 chmod 755 mysql

         Deleting any blank users or passwords, and creating a valid
         user is shown below.

         STEP 1:

           First, connect to the mysql database
           with the connect command:

             mysql&gt; connect mysql;

         STEP 2:

           Next, delete all blank accounts and/or
           global host listing:

            mysql&gt; DELETE FROM user WHERE User = '';
            mysql&gt; DELETE FROM db WHERE Host = '%';

         STEP 3:

           Delete any accounts with blank passwords:

            mysql&gt; DELETE FROM user where password='';

         STEP 4:

           Create a valid admin account. The example
           here creates admin1.

            mysql&gt; GRANT ALL PRIVILEGES ON *.* TO admin1@localhost
                   IDENTIFIED BY 's3cr3tpass45' WITH GRANT OPTION;

                  or if you want the account to get access from
                  any host.

            mysql&gt; GRANT ALL PRIVILEGES ON *.* TO admin1@"%"
                   IDENTIFIED BY 's3cr3tpass45' WITH GRANT OPTION;

          STEP 5:

            Restart the server "/etc/init.d/mysql restart"</pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/installation-configured-for-encryption-c-api-and-user-defined-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use CONCAT to include text in SELECT results in MySQL</title>
		<link>http://ossmall.info/mysql-use-concat-to-include-text-in-select-results/</link>
		<comments>http://ossmall.info/mysql-use-concat-to-include-text-in-select-results/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 13:34:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ossmall.info/mysql-use-concat-to-include-text-in-select-results/</guid>
		<description><![CDATA[Function CONCAT allows the SELECT statements to act like printf commands by ataching text results to query results and so on Example : Generate a list of links in HTML from a table &#8216;mylinks&#8217; with the columns &#8216;urls&#8217; (http://www.ossmall.info) with &#8216;title&#8217; (Open Software Solutions) The output will look like this : &#60;a href=&#8221;http://www.ossmall.info&#8221;&#62;Open Software Solutions&#60;/a&#62;&#60;br [...]]]></description>
			<content:encoded><![CDATA[<p>Function <strong>CONCAT </strong>allows the <strong> SELECT</strong> statements to act like printf commands by ataching text  results to query results and so on</p>
<p><strong>Example </strong>:</p>
<p>Generate a   list of links in HTML from a table &#8216;mylinks&#8217; with the columns &#8216;urls&#8217; (http://www.ossmall.info) with  &#8216;title&#8217; (Open Software Solutions)</p>
<p>The output will look like this  :</p>
<p><strong>&lt;a href=&#8221;http://www.ossmall.info&#8221;&gt;Open Software Solutions&lt;/a&gt;&lt;br /&gt;</strong></p>
<p>To do this you must use a select statement like:</p>
<p><strong> SELECT CONCAT(&#8216;&lt;a href=&#8221;&#8216;, urls, &#8216;&#8221;&gt;&#8217;, title, &#8216;&lt;/a&gt;&lt;br /&gt;&#8217;) FROM mylinks;</strong></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/mysql-use-concat-to-include-text-in-select-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

