How to Create MySQL Password


I used to use MySQL that integrated in PHP5 package. When there are database systems course in college, they used MySQL that integrated in XAMPP package.
There are many differences in both syntax, and of course it's a bit inconvenient.
eg syntax for open MySQL and create a table in databases.

here for example:

C:\Users\dewi>cd C:\xampp\mysql\bin

C:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 31
Server version: 5.1.37 Source distribution

mysql> show databases;

mysql> create database ball tournament;

mysql> use ball tournament;
Database changed


mysql> create table goal(kd_goal varchar(2) primary key,no int(2), name
 varchar(30) not null,total int(3)not null,constraint fkno foreign key
(no) references players(no) on update cascade on delete cascade
) type=innodb;

when I used MySQL in php5 package, when installing I was required to create a password.
but not with this XAMPP package. I had to make a manual.
Here the syntax:

mysql>grant all on *.* to root@localhost identified by 'your password';

Hope this useful for u. See ya!

0 comments: