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:
- C# Connect MYSQL Error: MySql.Data.MySqlClient.MySqlException:“SSL Connection error.”
- [Solved] Django configures MySQL Error: NameError: name ”_MySQL ‘is not defined
- [Solved] workbench ssl connection error ssl is required but the server
- C# connection MySQL error: SSL connection error [Solved]
- IDEA maven Config MYSQL Connection Error: Could not create connection to database server.
- [Solved] FATAL ERROR: please install the following Perl modules before executing /application/mysql/scripts/mysql_install_db: Data::Dumper
- (Fixed) workbench MySQL Error Code: 2013. Lost connection to MySQL server during query
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- [Solved] docker mysql SQLSTATE[HY000] [2002] Connection refused
- MySQL (version 8.0) connection error: 1251 [How to Solve]
- [Solved] There is a problem with mysql8.0 without password in Navicat connection
- host ‘‘ is not allowed to connect to this mysql server Connect MYSQL Error
- Android connection to cloud MySQL error: java.lang.NoClassDefFoundError Failed resolution of LjavasqlSQLType
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] MySQL connection error: communications link failure
- mysql workbench Error Code: 1046. No database selected Select the default DB to be used by doubl
- [Solved] Error Code: 2013. Lost connection to MySQL server during query
- Docker: How to Solve MYSQL8 & Navicat remote connection error
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- [Solved] mysql [ERR] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’