Difference between revisions of "MySQL Notes"

From OpenEMR Project Wiki
(Created page with "==Files== {| style="margin: 0 0em 0 0em;" |- | width="250" | <tt style="font-size: 130%">/etc/mysql/my.cnf</tt> | width="400" | MySQL Config File |- | <tt style="font-size: 130%"...")
 
 
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
| <tt style="font-size: 130%"></tt>
| <tt style="font-size: 130%"></tt>
|  
|  
|}
|}
 
<br>
 
==Config File Parameters==
==Config File Parameters==
{| style="margin: 0 0em 0 0em;"
{| style="margin: 0 0em 0 0em;"
Line 50: Line 52:
|  
|  
|}   
|}   
*Login to MySQL
::<tt style="font-size: 130%"> mysqladmin -u root -p</tt>
*Change Password
::<tt style="font-size: 130%"> mysqladmin -u root -p password yourpassword</tt>
*Create Database
::<tt style="font-size: 130%">mysqladmin -u root -p create database1</tt>


<br>
<br>
==MySQL Console Commands==
==MySQL Console Commands==
*Commands can span several lines.  Semicolon marks end of command.  Semicolon at end of line executes command.
*Commands can span several lines.  Semicolon marks end of command.  Semicolon at end of line executes command.
<br>
 
*Set Password for Root
*Set Password for Root
::<tt style="font-size: 130%">SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');</tt>
::<tt style="font-size: 130%">SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');</tt>
<br>
 
*Create Database
*Create Database
::<tt style="font-size: 130%">CREATE DATABASE database1;</tt>
::<tt style="font-size: 130%">CREATE DATABASE database1;</tt>
<br>
 
*Exit MySQL
::<tt style="font-size: 130%">\q</tt>

Latest revision as of 14:57, 31 May 2014

Files

/etc/mysql/my.cnf MySQL Config File
/usr/share/mysql Location of sample config files.


Config File Parameters

bind-address Default is localhost. To access mysql from networked computer, change to IP address.



Configuration

  • xxx
xxx


Testing

  • xxx



Command Line Commands

mysql -u root
  • Login to MySQL
mysqladmin -u root -p
  • Change Password
mysqladmin -u root -p password yourpassword
  • Create Database
mysqladmin -u root -p create database1


MySQL Console Commands

  • Commands can span several lines. Semicolon marks end of command. Semicolon at end of line executes command.
  • Set Password for Root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');
  • Create Database
CREATE DATABASE database1;
  • Exit MySQL
\q