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;
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;
本文介绍了MySQL服务器的相关操作,包括启动、关闭、作为Windows服务启动和移除等,还涉及连接与断开服务器的方法。同时,阐述了数据库和表的管理,如显示数据库、切换数据库、显示表、描述表以及向表中加载数据等操作。

被折叠的 条评论
为什么被折叠?



