---------------------------------------------------------------------------
OperationalError Traceback (most recent call last)
<ipython-input-4-abfe69e1e4f1> in <module>()
----> 1 conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='lch@2017', db='studentsdb')
D:\AnacondaInstalled\lib\site-packages\pymysql\__init__.py in Connect(*args, **kwargs)
88 """
89 from .connections import Connection
---> 90 return Connection(*args, **kwargs)
91
92 from pymysql import connections as _orig_conn
D:\AnacondaInstalled\lib\site-packages\pymysql\connections.py in __init__(self, host, user, password, database, port, unix_socket, charset, sql_mode, read_default_file, conv, use_unicode, client_flag, cursorclass, init_command, connect_timeout, ssl, read_default_group, compress, named_pipe, no_delay, autocommit, db, passwd, local_infile, max_allowed_packet, defer_connect, auth_plugin_map, read_timeout, write_timeout)
686 self._sock = None
687 else:
--> 688 self.connect()
689
690 def _create_ssl_ctx(self, sslp):
D:\AnacondaInstalled\lib\site-packages\pymysql\connections.py in connect(self, sock)
904
905 self._get_server_information()
--> 906 self._request_authentication()
907
908 if self.sql_mode is not None:
D:\AnacondaInstalled\lib\site-packages\pymysql\connections.py in _request_authentication(self)
1112
1113 self.write_packet(data)
-> 1114 auth_packet = self._read_packet()
1115
1116 # if authentication method isn't accepted the first byte
D:\AnacondaInstalled\lib\site-packages\pymysql\connections.py in _read_packet(self, packet_type)
979
980 packet = packet_type(buff, self.encoding)
--> 981 packet.check_error()
982 return packet
983
D:\AnacondaInstalled\lib\site-packages\pymysql\connections.py in check_error(self)
391 errno = self.read_uint16()
392 if DEBUG: print("errno =", errno)
--> 393 err.raise_mysql_exception(self._data)
394
395 def dump(self):
D:\AnacondaInstalled\lib\site-packages\pymysql\err.py in raise_mysql_exception(data)
105 errval = data[3:].decode('utf-8', 'replace')
106 errorclass = error_map.get(errno, InternalError)
--> 107 raise errorclass(errno, errval)
OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")