Studying note 1 of mysql

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




 

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值