Error Messages:
PS D:\test\orchard_liang>python manage.py sqlmigrate app 0001
Traceback (most recent call last):
File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 219, in ensure_connection
self.connect()
File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
return func(*args, **kwargs)
File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
return func(*args, **kwargs)
File "D:\Python37\lib\site-packages\django\db\backends\mysql\base.py", line 234, in get_new_connection
connection = Database.connect(**conn_params)
File "D:\Python37\lib\site-packages\MySQLdb\__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "D:\Python37\lib\site-packages\MySQLdb\connections.py", line 179, in __init__
super(Connection, self).__init__(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2026, 'SSL connection error: unknown error number')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "D:\Python37\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
utility.execute()
File "D:\Python37\lib\site-packages\django\core\management\__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Python37\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\Python37\lib\site-packages\django\core\management\commands\sqlmigrate.py", line 29, in execute
return super().execute(*args, **options)
File "D:\Python37\lib\site-packages\django\core\management\base.py", line 398, in execute
output = self.handle(*args, **options)
File "D:\Python37\lib\site-packages\django\core\management\commands\sqlmigrate.py", line 37, in handle
loader = MigrationLoader(connection, replace_migrations=False)
File "D:\Python37\lib\site-packages\django\db\migrations\loader.py", line 53, in __init__
self.build_graph()
File "D:\Python37\lib\site-packages\django\db\migrations\loader.py", line 220, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "D:\Python37\lib\site-packages\django\db\migrations\recorder.py", line 77, in applied_migrations
if self.has_table():
File "D:\Python37\lib\site-packages\django\db\migrations\recorder.py", line 55, in has_table
with self.connection.cursor() as cursor:
File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
return func(*args, **kwargs)
File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 259, in cursor
return self._cursor()
File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 235, in _cursor
self.ensure_connection()
File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
return func(*args, **kwargs)
File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 219, in ensure_connection
self.connect()
File "D:\Python37\lib\site-packages\django\db\utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 219, in ensure_connection
self.connect()
File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
return func(*args, **kwargs)
File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
return func(*args, **kwargs)
File "D:\Python37\lib\site-packages\django\db\backends\mysql\base.py", line 234, in get_new_connection
connection = Database.connect(**conn_params)
File "D:\Python37\lib\site-packages\MySQLdb\__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "D:\Python37\lib\site-packages\MySQLdb\connections.py", line 179, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2026, 'SSL connection error: unknown error number')
Reason: SSL of the higher versions of MySQL is turned on by default
solution: turn off SSL
Step 1: check the SSL startup first
Login mysql and then enter the commands below:
mysql> SHOW VARIABLES LIKE '%ssl%';
Step 2: Modify the configuration file my.ini
# PATH: C:\ProgramData\MySQL\MySQL Server 8.0
[mysqld]
skip_ssl # ssl
Step 3: restart MySQL service
ctrl+shift+esc key to call up task manager -> services -> find mysql service -> right click and rerun
Step 4: re execute the command:
mysql> SHOW VARIABLES LIKE '%ssl%';
Read More:
- [Solved] Django configures MySQL Error: NameError: name ”_MySQL ‘is not defined
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] Error: ER_HOST_NOT_PRIVILEGED: Host ‘x.x.x.x‘ is not allowed to connect to this MySQL server
- [Solved] Python import Error: pip –upgrade Error: ERROR: Cannot uninstall ‘dnspython‘. It is a distutils installed
- Android connection to cloud MySQL error: java.lang.NoClassDefFoundError Failed resolution of LjavasqlSQLType
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- MySQL Install Error: MySQL error 1042: Unable to connect to any of the specified MySQL hosts
- [Solved] docker mysql SQLSTATE[HY000] [2002] Connection refused
- Python calls the MySQLdb library, and an error “Library not loaded: libmysqlclient.18.dylib” is reported
- DVWA Uncaught Error: Call to undefined function mysql_connect() in /Applications/XAMPP/xampp
- [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata
- [Solved] SQLSTATE[HY000] [2002] Connection refused to report an error when PHP connects to mysql in the docker container
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- [error][/usr/share/perl5/vendor_perl/MHA/SSHCheck.pm, ln63] Permission denied (publickey,gssapi-ke
- Problems in connecting mysql8.0 in IDEA [How to Solve]
- Mysqlclient Error: ERROR: No matching distribution found for mysqlclient/OSError: mysql_config not found
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- [Solved] Caused by: java.sql.SQLException: Access denied for user ‘root‘@‘hadoop102‘ (using password: YES)