Changes

Jump to navigation Jump to search

Coral: mysql console

6,872 bytes added, 13:39, 12 November 2011
Created page with "<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font..."
<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font-size:12px">'''''Coral'' :'''&nbsp; [[Coral: mysql intro|MySQL]] | [[Coral: mysql change password|Change password]] | [[Coral: mysql restore password|Restore password]] | [[Coral: mysql console|MySQL Console]] | [[Coral: mysql create delete database|Create delete Database]] | [[Coral: mysql create restricted user|Create Restricted User]] | [[Coral: mysql edit restricted user|Edit Restricted User]]</span></div>

{|style="margin-top:5px;"
|-valign="top"
|
<span style="margin-bottom:5px;font-size:25px;color: #31799F;">MySQL Console</span>

The MySQL server can be administered from a command window. Uniform Server provides a short cut named MySQL console whichs opens a command window with the correct path to the MySQL utilities folder already set. Apart from cosmetics, it is identical to a standard command window.


This page focuses on using MySQL console. It is not intended as a definitive guide but just an introduction to show you how to access and use MySQL client.

__TOC__

|
{| cellpadding="0" cellspacing="0" style="margin-left:6px;margin-bottom:5px;padding-left:6px;padding-right:6px;font-size:11px;background-color: #FFFFEB;border: 1px solid darkslateblue;"
|-
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral
|-
|&nbsp;||[[Coral: Introduction|Home]]
|-
|&nbsp;||[[Coral: start quick start|Quick Start]]
|-
|&nbsp;||[[Coral: general intro|General]]
|-
|&nbsp;||[[Coral: apache intro|Apache]]
|-
|<span style="font-size: 14px;">»</span>||[[Coral: mysql intro|MySQL]]
|-
|&nbsp;||[[Coral: php intro|PHP]]
|-
|&nbsp;||[[Coral: msmtp intro|MSMTP]]
|-
|&nbsp;||[[Coral: cron intro|CRON]]
|-
|&nbsp;||[[Coral: dtdns intro|DtDNS]]
|-
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]
|-
|&nbsp;||[[Coral: perl intro|Perl]]
|-
|&nbsp;||[[Coral: index main|Main Index]]
|}
|}

==Command window==
Using a command window to administer the MySQL server is not specific to The Uniform Server. Running a standard command window is the same for any Windows MySQL installation. The Uniform Server’s MySQL console sets the paths and cosmetics transparently. With a command window open you can access the MySQL server utilities mysql client and mysqladmin. MySQL client allows you to run SQL commands, for example to create or delete databases. The following covers opening a standard command window and then The Uniform Server's preferred alternative MySQL console.

===How to run a standard command window===

To open a command window, run the command '''cmd''' from the start menu. Running a MySQL utility program requires navigating to its binary folder.

'''Note:''' The path where you installed The Uniform Server may be different; substitute your path as appropriate.


{|
|-valign="top"
|
# Start a command window: ('''Start''' > click on '''Run''' > type cmd click '''OK''')
# Alternatively: Click '''Start''' > '''All Programs''' > '''Accessories''' > click '''Command Prompt'''
# Type following lines into the command window:
#* '''cd \'''
#* '''cd C:\UniServer\usr\local\mysql\bin'''

The dialogue in the command window looks similar to that on the right.

'''Note:''' To use the command window you must have the MySQL server running.
|
[[Image:Coral_mysql_standard_cmd_window.gif]]
|}

'''''[[#top | Top]]'''''
===MySQL console command window short cut===
{|
|-valign="top"
|
Running MySQL console from UniController has a number of advantages. The button is enabled only when the MySQL server is running. Server location tracking allows the correct folder to be automatically selected when the console window is open. Opening a console window requires only a single button click.

# Start UniController
# Start MySQL server
# Click '''MySQL console''' button. Opens window shown on right
|
[[Image:Coral_mysql_us_cmd_window.gif]]
|}

'''''[[#top | Top]]'''''
===Quick MySQL binary folder check===
When running MySQL utilities, the working directory is changed to the MySQL folder: UniServer\usr\local\mysql\bin.

{|
|-valign="top"
|
To check the working directory, type the '''dir''' command into either<br />
of the above windows. The result should be as on the right.

* mysql.exe - MySQL client runs SQL commands
* mysqladmin.exe - MySQL admin
* mysqldump.exe - Database dump
|
<pre>
C:\UniServer\usr\local\mysql\bin>dir
Directory of C:\UniServer\usr\local\mysql\bin
21/06/2011 19:55 4,001,792 libmysql.dll
21/06/2011 19:54 4,106,240 mysql.exe
21/06/2011 19:54 4,037,632 mysqladmin.exe
21/06/2011 19:54 8,153,600 mysqld1.exe
21/06/2011 19:54 4,094,976 mysqldump.exe
C:\UniServer\usr\local\mysql\bin>
</pre>
|}

'''''[[#top | Top]]'''''
==Start MySQL Client==
{|
|-valign="top"
|
To start MySQL Client, type the following at the command window:

* mysql -uroot -proot

Note 1: Do not copy and paste! Type the line in as shown.

* -u stands for user name. Immediately follow that with the user name (no spaces)
* -p stands for user password. Immediately follow that with the password (no spaces)


Note 2: The''' mysql'''> prompt indicates you are in '''MySQL monitor''' and it is ready to receive your commands.

Note 3: Quit MySQL monitor by typing the command''' exit'''
|
On successful connection, you will receive a message similar to this:<br />
<pre>
C:\UniServer\usr\local\mysql\bin>mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 53
Server version: 5.5.14 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

mysql> exit
Bye

</pre>
|}

'''''[[#top | Top]]'''''
==Related topics==

[[Coral: mysql change password#Set New MySQL root user password using MySQL Console|Set New MySQL root user password using MySQL Console]]<br />
[[Coral: mysql change password#Restore MySQL root user password using command window|Restore MySQL root user password using command window]]<br />
[[Coral: mysql create delete database#Create delete Database using command window|Create delete Database using command window]]<br />
[[Coral: mysql create restricted user#Create Restricted MySQL User using command window|Create Restricted MySQL User using command window]]<br />
[[Coral: mysql create restricted user#Delete Restricted MySQL User using command window|Delete Restricted MySQL User using command window]]<br />
[[Coral: mysql create restricted user#Edit Restricted MySQL User using command window|Edit Restricted MySQL User using command window]]

'''''[[#top | Top]]'''''

----

[[Category: Uniform Server 8-Coral]]

Navigation menu