1. install MySQL
sudo apt-get install mysql-server mysql-client
2. Verifying the installation
sudo service MySQL restart
3. Verify that MySQL is started
PS Aux|grep MySQL
4. using the database
mysql> CREATE database name DEFAULT Charset=utf8; Create a database
Mysql> GRANT SELECT, INSERT, UPDATE, DELETE, create, DROP, INDEX, ALTER, create temporary TABLES, LOCK TABLES on data The name of the library. * to ' username ' @ ' localhost ' identified by ' password '; // Create user for database
Mysql-u User name- p// login mysql
Use database name // using database
Show TABLES// Show table in database
SHOW COLUMNS from person; Show Table Structure
Mysql>create TABLE Persons (
-id_p int not NULL auto_increment
-LastName varchar (255) Not NULL,
FirstName varchar (255),
Address varchar (255),
-City varchar (255),
PRIMARY Key (id_p) // Set Primary key
); // CREATE TABLE Persons
MySQL Common commands