Studying note 1 of mysql

来源:互联网 发布:阿里云企业邮箱格式 编辑:程序博客网 时间:2024/05/16 06:30
1.Start the server:
 shell>mysqld  
 or
 shell>mysqld --console  : The server will continue to write to the console any further dianostic output it produces.
2.Shutdow the server
shell>mysqladmin -h -u  -p shutdown
such as shell>mysqladmin -h 192.168.12.252 -u root -p shutdown :the server in 192.168.12.252
            shell>mysqladmin -u root -p shutdown :the server in localhost
3.Start mysql as a window service.
shell>msyqld --install serviceName --defaults-file
such as shell>mysqld --install
            shell>mysqld --install mmgg
            shell<mysqld --install mmgg --defaults-file=c:/mmgg
4.Remove a server that is installed as a service.
shell>mysqld --remove serviceName
such as shell>mysqld --remove
            shell>mysqld --remove MySQL
5.Connect to the server.
shell>mysql -h -u -p 
such as shell>mysql -h 192.168.12.252 -u root -p
            shell>mysql -u root -p
6.Disconnect from the server.
mysql>quit(/q)
7.Show all databases.
mysql>show databases;
9.Chanage database.
mysql>use database;
10.Show all tables of one database.
mysql>show tables;
11.Describe one table.
mysql>describe tableName.
12.Load data into a table.
mysql>LOAD DATA LOCAL INFILE 'fileName' INTO TABLE tableName;
such as mysql>LOAD DATA LOCAL INFILE 'd:/mysql/data/user.txt' INTO TABLE user;
13.Show the selected database.
mysql>select database();
14.Describe table.
mysql>describe tableName;
such as describe user;




 

 
原创粉丝点击