<?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>TutorBoy Articles &#187; DataBase</title>
	<atom:link href="http://articles.tutorboy.com/topics/database/feed" rel="self" type="application/rss+xml" />
	<link>http://articles.tutorboy.com</link>
	<description>Online Complete Reference</description>
	<lastBuildDate>Thu, 09 Sep 2010 09:53:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MySQL Prepared Statements</title>
		<link>http://articles.tutorboy.com/database/mysql-prepared-statements.html</link>
		<comments>http://articles.tutorboy.com/database/mysql-prepared-statements.html#comments</comments>
		<pubDate>Thu, 13 May 2010 13:24:07 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[DataBase]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=1591</guid>
		<description><![CDATA[Prepared statements are the ability to set up a statement once, and then execute it many times with different parameters. They are designed to replace building ad hoc query strings, and do so in a more secure and efficient manner. &#8230; <a href="http://articles.tutorboy.com/database/mysql-prepared-statements.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Prepared statements are the ability to set up a statement once, and then execute it many times with different parameters.  They are designed to  replace building ad hoc query strings, and do so in a more secure and efficient  manner.</p>
<h1>Why Prepared Statements?</h1>
<ul>
<li> For security and better performance.</li>
<li> Prevent a very common type of vulnerability called an SQL injection attack.</li>
<li> When dealing with prepared statements, you don&#8217;t need to worry about functions that escape all of the necessary trouble characters, such as the single quote, double quote, and backslash characters.</li>
<li> The prepared statements executes only at initial time, so it will increase the performance. . Then if you execute the query many times, it will no longer have that overhead. This pre-parsing can lead to a speed increase if you need to run the same query many times, such as when doing many INSERT statements.</li>
<li> Performance may increase is through the use of the new binary protocol that prepared statements can use. The traditional protocol in MySQL always converts everything into strings before sending them across the network.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/database/mysql-prepared-statements.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changing MySql User Password</title>
		<link>http://articles.tutorboy.com/database/changing-mysql-user-password.html</link>
		<comments>http://articles.tutorboy.com/database/changing-mysql-user-password.html#comments</comments>
		<pubDate>Mon, 23 Nov 2009 07:03:40 +0000</pubDate>
		<dc:creator>Arun C P</dc:creator>
				<category><![CDATA[DataBase]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=486</guid>
		<description><![CDATA[The mysqladmin tool can be used for changing MySql user&#8217;s password. The following line of code will change the user1&#8242;s password to &#8220;newpassword&#8221;. mysqladmin -u user1 -p password "newpassword"]]></description>
			<content:encoded><![CDATA[<p>The mysqladmin tool can be used for changing MySql user&#8217;s password. The following line of code will change the user1&#8242;s password to &#8220;newpassword&#8221;.</p>
<pre class="brush:bash">mysqladmin -u user1 -p password "newpassword"</pre>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/database/changing-mysql-user-password.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revoking MySQL Root Privilege</title>
		<link>http://articles.tutorboy.com/database/revoking-mysql-root-privilege.html</link>
		<comments>http://articles.tutorboy.com/database/revoking-mysql-root-privilege.html#comments</comments>
		<pubDate>Sat, 21 Nov 2009 04:36:20 +0000</pubDate>
		<dc:creator>Arun C P</dc:creator>
				<category><![CDATA[DataBase]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=480</guid>
		<description><![CDATA[If we lost the root privilege or password, it can be retrieved by the following steps : Stopping MySQL : Shell Command /etc/init.d/mysqld stop wait until MySQL stops, then run the following commands : mysqld_safe --skip-grant-tables &#38; Then you will &#8230; <a href="http://articles.tutorboy.com/database/revoking-mysql-root-privilege.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If we lost the root privilege or password, it can be retrieved by the following steps :<br />
Stopping MySQL :</p>
<h2>Shell Command</h2>
<pre class="brush:bash">/etc/init.d/mysqld stop</pre>
<p>wait until MySQL stops, then run the following commands :</p>
<pre class="brush:bash">mysqld_safe --skip-grant-tables &amp;</pre>
<p>Then you will be you will be able to login as root with no password.</p>
<pre class="brush:bash">mysql -uroot mysql</pre>
<p><span id="more-480"></span><br />
In MySQL command prompt use the following commands :</p>
<pre class="brush:bash">use mysql;
update user set password=PASSWORD("newrootpassword") where User='root';
FLUSH PRIVILEGES;</pre>
<p>Restart MySQL :</p>
<pre class="brush:bash">/etc/init.d/mysqld stop

/etc/init.d/mysqld start</pre>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/database/revoking-mysql-root-privilege.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copying value from one table to another</title>
		<link>http://articles.tutorboy.com/database/copying-value-from-one-table-to-another.html</link>
		<comments>http://articles.tutorboy.com/database/copying-value-from-one-table-to-another.html#comments</comments>
		<pubDate>Thu, 19 Nov 2009 07:38:13 +0000</pubDate>
		<dc:creator>Arun C P</dc:creator>
				<category><![CDATA[DataBase]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=476</guid>
		<description><![CDATA[This can be done by using both insert and select queries. Example : Suppose we have two tables student and mark : Student id &#124; integer &#124; name &#124; text &#124; Mark id &#124; integer &#124; name &#124; text &#124; &#8230; <a href="http://articles.tutorboy.com/database/copying-value-from-one-table-to-another.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This can be done by using both insert and select queries.</p>
<h2>Example :</h2>
<pre>Suppose we have two tables student and mark :
Student
id     | integer |
name   | text    |

Mark
id     | integer |
name   | text    |
mark | integer |

We can copy all values of student to mark by using the following query :

insert into mark select * from student;
 id | name  | mark
----+-------+--------
  1 | test  |
  2 | test1 |
  3 | test2 |
  4 | test3 |

We can copy one column of student to mark by using the following query :

insert into mark(name) select name from student</pre>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/database/copying-value-from-one-table-to-another.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDO Connection And DNS Settings For Different Databases.</title>
		<link>http://articles.tutorboy.com/database/pdo-connection-and-dns-settings-for-different-databases.html</link>
		<comments>http://articles.tutorboy.com/database/pdo-connection-and-dns-settings-for-different-databases.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 07:44:25 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[DataBase]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[DSN]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[pdo]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=238</guid>
		<description><![CDATA[PDO(PHP Data Objects) is one of main feature of PHP 5.1 to managing databases. It is developed to provide a lightweight interface for different database engines. And one of the very good features of PDO is that it works like &#8230; <a href="http://articles.tutorboy.com/database/pdo-connection-and-dns-settings-for-different-databases.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><strong>PDO</strong>(PHP Data Objects) is one of main feature of PHP 5.1 to managing databases. It is developed to provide a lightweight interface for different database engines. And one of the very good features of PDO is that it works like a Data Access Layer so that you can use the same function names for all database engines.</p>
<h2>PHP Script</h2>
<pre class="brush:php">&lt;?php
$db_name ='test_db';
$db_host = 'localhost';
$db_user = 'root';
$db_password = 'mypassword';
$dsn = 'mysql:dbname=$db_name;host=$db_host;';
$connectionString = new PDO($dsn, $db_user, $db_password);
?&gt;</pre>
<p>The DSN settings for different database engines to connect with PDO. Supported database drivers are as shown below:</p>
<h3>PDO_DBLIB for FreeTDS/Microsoft SQL Server/Sybase</h3>
<pre class="brush:php">mssql:host=localhost;dbname=test_db
sybase:host=localhost;dbname=test_db
dblib:host=localhost;dbname=test_db</pre>
<p><span id="more-238"></span></p>
<h3>PDO_INFORMIX for IBM Informix Dynamic Server</h3>
<pre class="brush:php">informix:host=host.domain.com;service=9800;database=test_db;
server=ids_server;protocol=onsoctcp;</pre>
<pre class="brush:php">EnableScrollableCursors=1;</pre>
<h3>PDO_MYSQL for MySQL 3.x/4.x/5.x</h3>
<pre class="brush:php">mysql:host=localhost;port=3307;dbname=test_db
mysql:unix_socket=/tmp/mysql.sock;dbname=test_db</pre>
<h3>PDO_OCI for Oracle Call Interface</h3>
<pre class="brush:php">oci:mydb
oci:dbname=//localhost:1521/test_db</pre>
<h3>PDO_ODBC for ODBC v3 (IBM DB2, unixODBC and win32 ODBC)</h3>
<pre class="brush:php">odbc:test_db
odbc:DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=localhost;PORT=50000;DATABASE=test_db;
PROTOCOL=TCPIP;UID=db_user_name;PWD=db_password;
odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:db.mdb;Uid=Admin</pre>
<h3>PDO_PGSQL for PostgreSQL</h3>
<pre class="brush:php">pgsql:dbname=test_db;user=db_user_name;password=db_password;
host=localhost;port=5432</pre>
<h3>PDO_SQLITE for SQLite 3 and SQLite 2</h3>
<pre class="brush:php">sqlite:/opt/databases/mydb.sq3
sqlite::memory:
sqlite2:/opt/databases/mydb.sq2
sqlite2::memory:</pre>
<h3>PDO_FIREBIRD for Firebird/Interbase 6</h3>
<pre class="brush:php">firebird:user="db_user_name;Password=db_password;
Database=DATABASE.GDE;DataSource=localhost;Port=3050;</pre>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/database/pdo-connection-and-dns-settings-for-different-databases.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
