DBSCAN is one of the most popular algorithms for cluster analysis. It can discover all clusters with arbitrary shape and separate noises. But this algorithm canpsilat choose parameter according to distributing of dataset. It simply uses the global MinPts parameter, so that the clustering result of multi-density database is inaccurate. In addition, when it is used to cluster large databases, it will cost too much time. For these problems, we propose GMDBSCAN algorithm which is based on spatial index and grid technique. An experimental evaluation shows that GMDBSCAN is effective and efficient.