连接远程数据库
- 语法:
mysql -h host -P port -u user -ppassword
注意:大写P表示端口,小写p表示密码,且小写p参数与密码之间不能有空格,否则将会被识别为连接的数据库名称
使用
- 查看表内数据数量:
select count( colume_name ) from table_name
- 创建表:注意:列命和表名需要使用反引号!
1
2
3
4create table `table_name`(
`colume_name` int not null primary key,
`colume_name` datetime null,
)