(1) unzip mysql-noinstall-5.0.41-win32.zip into D:\
with the name mysql
(2) creat my.ini file
path: mysql\my.ini
my.ini
---------------------------------------------
[WinMySQLAdmin]
Server=D:\mysql\bin\mysqld-nt.exe
[mysqld]
basedir=D:\mysql
datadir=D:\mysql\data
----------------------------------------------
(3)
MS-Dos operator:
(a):cd -> D:\mysql\bin
mysqld --install mysql --defaults-file= D:\mysql\my.ini
(4)
net start mysql
(5)
net stop mysql
(6)
sc delete mysql
(7)common cmd
(a)change password
//meng is old password and mengsj is your new's
mysqladmin -u root -pmeng password mengsj
//mengsj is old password and "" is your new's
mysqladmin -u root -pmengsj password ""
(b)login
mysql -u root -p
mysql -h localhost -u root -p
(c)login with the name root,then you can do the operators
//create new user
//all databases and the user name is test2 and password is password
grant select,insert,update,delete on *.* to test2@"%" Identified by "password"
//database which named test02 and the user name is test2 and password is password
grant select,insert,update,delete on test02.* to test2@localhost identified by "password"
//set the root's password with ""
grant select,insert,update,delete on *.* to root@localhost identified by "";
(8) examples
select now(), user(),version();
//cancle the cmd
\c
//see the databases you can operator
show databases;
//select the database you want to operator
select database();
//see the tables you can operator
show tables;
//create database
create database test02;
//select the database you want to operator
use test02;
create table testtb001(
last_name varchar(15) not null,
first_name varchar(15) not null,
city varchar(15) not null,
birth date not null,
death date null
);
create table testtb002(
password varchar(20) not null);
insert into testtb002(password) values ('aaa');
commit;
select * from testtb002;