MySQL Basics on Ubuntu 8.10

Information taken from help.ubuntu.com

Starting  mysql  shell

mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

With password

mysql -u root -p

Create a mysql database

mysql> CREATE DATABASE database1;

Create a mysql user

mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON database1.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword';

Leave a Reply

Your email address will not be published. Required fields are marked *


*