My SQL Administration
Submitted by guvnor on Wed, 06/23/2010 - 11:16
Contents
Introduction
This is a simple guide to mySQL administration using the command line client. Generally mySQL administration is not a difficult task especially with the different administration tools out there, not least phpMyadmin.Connecting to mySQL
To connect using the command line client you need to open a command line or a shell prompt. Then simply type: This is the most simple way to connect you to your mySQL server. Of course it is too simple for a lot of mySQL servers installations because we haven't specified any connection details. Connection details most commonly are the hostname and suitable security credentials such as user name and password. This is a more useful and more likely mySQL command line syntaxmysql -uroot -ps3cr3tpassw0rd -hlocalhost
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 319 Server version: 5.0.77 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
Creation of databases
To begin working on mySQL you need to create a database. This is a straight forward command.CREATE DATABASE <databasename> ;
CREATE DATABASE mystuff ;
#1007 - Can't create database 'mystuff'; database exists.CREATE DATABASE IF NOT EXISTS mystuff;use mystuff;