MySQL相关
2018-06-17 22:58:11来源:未知 阅读 ()
1.进入安装目录
cd E:\ZYXDocument\Software\mariadb-10.0.20-win32\bin
2.安装mysql服务
将E:\ZYXDocument\Software\mariadb-10.0.20-win32\my.ini 放入 C:\Windows中
mysqld --install mysql --defaults-file="E:\ZYXDocument\Software\mariadb-10.0.20-win32\my.ini"
mysqld --install mysql --defaults-file="E:/ZYXDocument/Software/mysql-5.6.25/my.ini"
mysqld --defaults-file="E:/ZYXDocument/Software/mysql-5.7.11/my.ini" --initialize-insecure
mysqld --install mysql --defaults-file="E:/ZYXDocument/Software/mysql-5.7.11/my.ini"
Host
User
3.启动mysql数据库服务
net start mysql
4.停止mysql数据库服务
net stop mysql
5.删除mysql数据库服务
mysqld remove mysql
6、修改mysql数据库的root密码(初始为空)
方法1: 用SET PASSWORD命令
mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('gis');
方法2:用mysqladmin
mysqladmin -u root password "gis"
如果root已经设置过密码,采用如下方法
mysqladmin -u root password oldpass "gis"
方法3: 用UPDATE直接编辑user表
mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('gis') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;
在丢失root密码的时候,可以这样
mysqld_safe --skip-grant-tables&
mysql -u root mysql
mysql> UPDATE user SET password=PASSWORD("gis") WHERE user='root';
mysql> FLUSH PRIVILEGES;
7、设置root权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'gis';
SET GLOBAL max_allowed_packet = 2*1024*1024*10;
DELETE p.*
FROM st_rsvr_r p
LEFT JOIN st_stbprp_b pp
ON p.stcd = pp.stcd
WHERE pp.stnm IS NULL
COMMIT;
SET PASSWORD FOR 'root'@'%' = PASSWORD('gis');
-----------------------------------------------------------------------------------------
空间查询相关操作
ALTER TABLE test_gis_station_hb ADD shape GEOMETRY AFTER lttd;
UPDATE test_gis_station_hb SET shape=GEOMFROMTEXT(CONCAT('POINT(', CAST(lgtd AS CHAR(20)), ' ', CAST(lttd AS CHAR(20)) ,')'))
SELECT ASTEXT(shape) shape, stcd FROM test_gis_station_hb
-----------------------------------------------------------
MYSQL查询重复记录的方法很多,下面就为您介绍几种最常用的MYSQL查询重复记录的方法,希望对您学习MYSQL查询重复记录方面能有所帮助。
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录
delete from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
and rowid not in (select min(rowid) from people group by peopleId having count(peopleId )>1)
3、查找表中多余的重复记录(多个字段)
select * from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1)
4、删除表中多余的重复记录(多个字段),只留有rowid最小的记录
delete from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)
5、查找表中多余的重复记录(多个字段),不包含rowid最小的记录
select * from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)
---------------------------------------------------------------------------------------------
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- MySQL replace函数怎么替换字符串语句 2020-03-09
- PHP访问MySQL查询超时怎么办 2020-03-09
- mysql登录时闪退 2020-02-27
- MySQL出现1067错误号 2020-02-27
- mysql7.x如何单独安装mysql 2020-02-27
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash