https://wiki.uniformserver.com/index.php?title=MySQL_Console&feed=atom&action=historyMySQL Console - Revision history2024-03-29T06:35:31ZRevision history for this page on the wikiMediaWiki 1.41.0https://wiki.uniformserver.com/index.php?title=MySQL_Console&diff=4830&oldid=prevOlajideolaolorun: Reverted edits by Upazixorys (Talk); changed back to last version by Ric2010-11-24T08:35:56Z<p>Reverted edits by <a href="/Special:Contributions/Upazixorys" title="Special:Contributions/Upazixorys">Upazixorys</a> (<a href="/index.php?title=User_talk:Upazixorys&action=edit&redlink=1" class="new" title="User talk:Upazixorys (page does not exist)">Talk</a>); changed back to last version by <a href="/User:Ric" title="User:Ric">Ric</a></p>
<a href="https://wiki.uniformserver.com/index.php?title=MySQL_Console&diff=4830&oldid=4556">Show changes</a>Olajideolaolorunhttps://wiki.uniformserver.com/index.php?title=MySQL_Console&diff=4556&oldid=prevUpazixorys at 01:03, 24 November 20102010-11-24T01:03:19Z<p></p>
<a href="https://wiki.uniformserver.com/index.php?title=MySQL_Console&diff=4556&oldid=3377">Show changes</a>Upazixoryshttps://wiki.uniformserver.com/index.php?title=MySQL_Console&diff=3377&oldid=prevRic at 22:28, 2 August 20082008-08-02T22:28:11Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 22:28, 2 August 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><span id="top"></span></del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{<ins style="font-weight: bold; text-decoration: none;">{Uc nav mysql}</ins>}</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><div style="padding:0;margin:0; border-bottom:3px inset #000000"></del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{<del style="font-weight: bold; text-decoration: none;">| </del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">|[[Image:uc_small_logo.gif | MPG UniCenter]] ||</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[MySQL separate user accounts | MySQL user accounts]] | </del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[MySQL Console | MySQL Console]] | </del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[MySQL phpMyAdmin | MySQL phpMyAdmin]] | </del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[MySQL That Extra Database | MySQL Extra Database]] | </del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[MySQL Lost Password | MySQL Lost Password]]</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">|</del>}</div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></div></del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">{| cellpadding="2"</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">|</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">__TOC__</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">||</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''MySQL creating users and setting permissions using MySQL console'''</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''MySQL creating users and setting permissions using MySQL console'''</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">|}</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>MySQL is a multi-user database, you can set up several different accounts on the same server with many varied permissions given to each user. This ability is part of what makes MySQL so powerful. You can use either MySQL console or phpMyAdmin to create users and grant permissions. This page focuses on using MySQL console. Not intended as a definitive guide but more of an introduction to show you how to access and run MySQL console within the UniServer environment. </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>MySQL is a multi-user database, you can set up several different accounts on the same server with many varied permissions given to each user. This ability is part of what makes MySQL so powerful. You can use either MySQL console or phpMyAdmin to create users and grant permissions. This page focuses on using MySQL console. Not intended as a definitive guide but more of an introduction to show you how to access and run MySQL console within the UniServer environment. </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== MySQL Privileges ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== MySQL Privileges ==</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l25">Line 25:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>MySQL console is an integral application of MYSQL you run this application from a command prompt on the machine that is running your MySQL server.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>MySQL console is an integral application of MYSQL you run this application from a command prompt on the machine that is running your MySQL server.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>I have assumed you are using Uniform Server defaults that is '''drive W''' and MySQL user '''name=root''' and '''password=root'''. (Important before going live remember to change your '''[[New Users<del style="font-weight: bold; text-decoration: none;">: </del>Security#MySQL Server Configuration | MySQL root password ]]''')</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>I have assumed you are using Uniform Server defaults that is '''drive W''' and MySQL user '''name=root''' and '''password=root'''. (Important before going live remember to change your '''[[New Users Security#MySQL Server Configuration | MySQL root password ]]''')</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>With both Apache and MySQL, servers running start a command window and navigate to where mysql.exe is located.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>With both Apache and MySQL, servers running start a command window and navigate to where mysql.exe is located.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l181">Line 181:</td>
<td colspan="2" class="diff-lineno">Line 167:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category: UniCenter]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category: UniCenter]]</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category: MySQL]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category: MySQL]]</div></td></tr>
</table>Richttps://wiki.uniformserver.com/index.php?title=MySQL_Console&diff=2979&oldid=prevMrX: Fixed link to New Users: Security2008-05-31T08:24:40Z<p>Fixed link to <a href="/New_Users:_Security" title="New Users: Security">New Users: Security</a></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:24, 31 May 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l25">Line 25:</td>
<td colspan="2" class="diff-lineno">Line 25:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>MySQL console is an integral application of MYSQL you run this application from a command prompt on the machine that is running your MySQL server.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>MySQL console is an integral application of MYSQL you run this application from a command prompt on the machine that is running your MySQL server.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>I have assumed you are using Uniform Server defaults that is '''drive W''' and MySQL user '''name=root''' and '''password=root'''. (Important before going live remember to change your '''[[New Users Security#MySQL Server Configuration | MySQL root password ]]''')</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>I have assumed you are using Uniform Server defaults that is '''drive W''' and MySQL user '''name=root''' and '''password=root'''. (Important before going live remember to change your '''[[New Users<ins style="font-weight: bold; text-decoration: none;">: </ins>Security#MySQL Server Configuration | MySQL root password ]]''')</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>With both Apache and MySQL, servers running start a command window and navigate to where mysql.exe is located.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>With both Apache and MySQL, servers running start a command window and navigate to where mysql.exe is located.</div></td></tr>
</table>MrXhttps://wiki.uniformserver.com/index.php?title=MySQL_Console&diff=2896&oldid=prevRic: New page: <span id="top"></span> <div style="padding:0;margin:0; border-bottom:3px inset #000000"> {| | MPG UniCenter || [[MySQL separate user accounts | MySQL user acc...2008-05-24T11:21:53Z<p>New page: <span id="top"></span> <div style="padding:0;margin:0; border-bottom:3px inset #000000"> {| |<a href="/File:Uc_small_logo.gif" title="File:Uc small logo.gif"> MPG UniCenter</a> || [[MySQL separate user accounts | MySQL user acc...</p>
<p><b>New page</b></p><div><span id="top"></span><br />
<div style="padding:0;margin:0; border-bottom:3px inset #000000"><br />
{| <br />
|[[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
[[MySQL separate user accounts | MySQL user accounts]] | <br />
[[MySQL Console | MySQL Console]] | <br />
[[MySQL phpMyAdmin | MySQL phpMyAdmin]] | <br />
[[MySQL That Extra Database | MySQL Extra Database]] | <br />
[[MySQL Lost Password | MySQL Lost Password]]<br />
|}<br />
</div><br />
{| cellpadding="2"<br />
|<br />
__TOC__<br />
||<br />
'''MySQL creating users and setting permissions using MySQL console'''<br />
|}<br />
MySQL is a multi-user database, you can set up several different accounts on the same server with many varied permissions given to each user. This ability is part of what makes MySQL so powerful. You can use either MySQL console or phpMyAdmin to create users and grant permissions. This page focuses on using MySQL console. Not intended as a definitive guide but more of an introduction to show you how to access and run MySQL console within the UniServer environment. <br />
== MySQL Privileges ==<br />
MySQL privileges allow each user to access and utilize only areas they need to perform their tasks. This prevents a user from accidentally accessing an area where he or she is not allowed access this adds to the security of the MySQL server.<br />
<br />
When connecting to a MySQL server, the '''host''' from which connection is made and a user '''name''' specified determines that users identity. This identity informs MySQL to allow access to the server and to assign privileges defined for this user.<br />
<br />
== MySQL console application ==<br />
MySQL console is an integral application of MYSQL you run this application from a command prompt on the machine that is running your MySQL server.<br />
<br />
I have assumed you are using Uniform Server defaults that is '''drive W''' and MySQL user '''name=root''' and '''password=root'''. (Important before going live remember to change your '''[[New Users Security#MySQL Server Configuration | MySQL root password ]]''')<br />
<br />
With both Apache and MySQL, servers running start a command window and navigate to where mysql.exe is located.<br />
<br />
=== Command window ===<br />
There are two ways to start a command window:<br />
<br />
* '''Start''' > click on '''Run''' > type '''cmd''' click '''OK'''<br />
Alternatively<br />
* Click '''Start''' > '''All Programs''' > '''Accessories''' > click '''Command Prompt '''<br />
<br />
Either method opens a command window the flashing curssor is refered to as the '''command prompt'''.<br />
<br />
=== Navigate to mysql.exe ===<br />
<table><br />
<tr><br />
<td valign="top" width="450"><br />
Type following lines into the command prompt:<br />
*'''W:'''<br />
*'''cd usr\local\mysql\bin'''<br />
<br />
This selects the folder where you run '''MySQL console'''<br />
</td><br />
<td width="6"><br />
&nbsp;<br />
<td><br />
<td><br />
Dialogue in the command prompt looks similar to this:<br />
<br />
<div style="background:#f0f0f0; border:1px solid #000000; padding-left:10px; width:60%"><br />
Microsoft Windows XP [Version 5.1.2600]<br><br />
(C) Copyright 1985-2001 Microsoft Corp.<br />
<br />
C:\Documents and Settings\mpg>'''w:'''<br><br />
W:\>'''cd usr\local\mysql\bin'''<br><br />
W:\usr\local\mysql\bin>_<br />
</div><br />
</td><br />
</tr><br />
</table><br />
=== Start MySQL console ===<br />
<table><br />
<tr><br />
<td valign="top" width="450"><br />
To start MySQL console, at the command prompt, type the following:<br />
* '''mysql –uroot –proot'''<br />
<br />
<br />
'''''Note 1:''''' Do not copy and paste you must type it in.<br />
<br />
* '''-u''' stands for user name. Immediately followed by user name (no spaces)<br />
* '''-p''' stands for user password. Immediately followed by password (no spaces)<br />
<br />
'''''Note 2:''''' The '''mysql>''' prompt indicates you are in MySQL monitor and it is ready to receive your commands.<br />
<br />
'''''Note 3:''''' Quit the monitor by typing '''exit'''<br />
</td><br />
<td width="6"><br />
&nbsp;<br />
<td><br />
<td><br />
On successful connection you will receive a message similar to this:<br />
<br />
<div style="background:#f0f0f0; border:1px solid #000000; padding-left:10px; width:60%"><br />
<br />
W:\usr\local\mysql\bin>'''mysql -uroot -proot'''<br><br />
Welcome to the MySQL monitor. Commands end with ; or \g.<br><br />
Your MySQL connection id is 216<br><br />
Server version: 5.0.41-community-nt MySQL Community Edition (GPL)<br><br />
<br />
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br><br />
<br />
mysql><br />
</div><br />
</td><br />
</tr><br />
</table><br />
To create users and set permissions, you must have the necessary permissions to do so. By default, Uniform Server's MySQL has such an account named '''root''' with password root (remember to change this) and all required permissions. It is constrained to run on local host access only.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Setting up a new user ==<br />
We are now ready to setup some MySQL user accounts. The statements that follow are entered in at the MySQL monitor (console) prompt. Be sure to include all of the '''quotations''' in the statements and to '''end each statement''' with a '''semicolon'''.<br />
<br />
=== Example 1 ===<br />
For our first example, we have a user named '''mpg3''' with a password '''mpg3abc''' we trust this person so will grant all privileges. He wants a database named '''mpg3_db''' accessible from '''local host'''.<br />
<br />
Start MySQL monitor and enter:<br />
'''create database mpg3_db;'''<br />
<br />
followed by:<br />
'''grant all privileges on mpg3_db.* to mpg3@"localhost" identified by 'mpg3abc';'''<br />
<br />
* First line creates a database named '''mpg3_db'''. This step can be left out if the database already exists.<br />
* Second line sets up the user and what privileges the user is allowed to use. Looking at this line in greater detail.<br />
<br />
:* '''grant all privileges on mpg3_db.*''' Specifies the database (mp3_db) a user will be allowed to access. The '''.*''' indicates that this user is permitted to work with all of the tables within the database mpg_db. (You can limit the user to one table, the name of that table should be specified after the period in place of the asterisk.<br />
:* '''mpg3@"localhost"''' This sets up the user information. The user named mpg3 is being created. The portion after the '''@''' indicates the host from which this user is allowed to connect. In this case, this user can only connect from the localhost.<br />
:* '''mpg3abc''' This is the password to be used by the user. (Always use a password that contains both random alpha and numeric characters.)<br />
<br />
=== Example 2 ===<br />
For our second example we have a user named '''mpg4''' with a password '''mpg4abc''' we trust this person hence will grant all privileges. He wants a database named '''mpg4_db''' accessible from '''any host'''.<br />
<br />
Start MySQL monitor and enter:<br />
'''create database mpg4_db;<br />
'''<br />
followed by:<br />
'''grant all privileges on *.* to mpg4@"localhost" identified by 'mpg4abc';'''<br />
<br />
As with the previous example, lets look at the statement piece by piece.<br />
<br />
* '''<nowiki>*.*</nowiki>''' This indicates that the user will be permitted to connect to all of the MySQL databases and all of the tables contained in those databases.<br />
* '''mpg4@"%"''' This sets up the user information. The user named mpg4 is being created. This time a host of "%" is used. This indicates that this user may connect to the database from any host or IP number. A more secure way to do this is to specify the IP number of the user, however sometimes this is not possible.<br />
*''''mpg4abc'''' As in the previous example sets the password.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Reducing User Privileges ==<br />
In both of the above examples, we created users with all privileges granted on their respective database(s). If the user is connecting from the Internet or a remote workstation, reduce these privileges or kiss your database good bye. Use the following statement to reduce privileges:<br />
<br />
'''grant select,insert,update,delete,create,drop on mpg3_db.* to mpg3@"%" identified by 'mpg3abc';'''<br />
<br />
With this statement, the user mpg3 is allowed limited access to the database mpg3_db from any host ("%") using the password mpg3abc.<br />
<br />
The '''grant''' statement specifies that this user is only allowed to run a limited amount of statements on the MySQL server. This user will be allowed to: '''select''' records, '''insert''' records, '''update''' records, '''delete''' records, '''create''' databases, and '''DROP''' (delete) DATABASEs. More importantly, this user is '''not permitted''' to create users and set privileges.<br />
<br />
You could further reduce a user's privileges by removing other items from the '''grant''' statement. Users should only be given permission to access the functions that are necessary to perform their tasks and not to compromise your server.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Refresh the MySQL grant tables ==<br />
Information you have changed or created when executing the above statements is stored in a database called mysql. this database was automatically created during MySQL installation. It contains several tables that hold all of the information pertaining to each user, the databases they have access to, the hosts they can connect from, and the privileges allowed for each.<br />
<br />
The only time MySQL reads data in these tables is when it first boots (runs). It does not read those tables again unless it is told to do so. Without this step, none of your newly created users or changes to existing users will take effect.<br />
<br />
There are several ways to reload the privilege tables, you can stop and re-start the MySQL server or issue the following command from MySQL console:<br />
'''flush privileges;'''<br />
<br />
This instructs the MySQL server to take another look at the user tables and hence puts all of your new users and privileges into operation.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== That extra database ==<br />
Have you discovered an extra database you cannot remove! This page explains why [[MySQL That Extra Database | information_schema]].<br />
<br />
Back to MySQL User Accounts [[MySQL separate user accounts | MySQL user accounts]] <br />
<br />
I am not one for typing my preference is to use [[MySQL phpMyAdmin | phpMyAdmin]].<br />
<br />
There are times when the power of MySQL console comes into it's own [[MySQL Lost Password | Lost Password]]<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: MySQL]]</div>Ric