Unix_socket="/Applications/MAMP/tmp/mysql/mysql. By changing to this, the problems seems to disappear (and I conclude for myself that the problem is in the oracle mysql connector). PS: I've temporarily given this up, and changed to PyMySQL instead of of the Oracle nnector. To check that you’ve successfully created the database, navigate to the TABLES section of the Sequel Pro window and locate classmatedatabase. It is only through the python nnector I get these errors. Create a Standard connection to your MySQL Server, using IP address 127.0.0.1 as the Host and your MySQL root credentials for the Username and Password. When I run queries from the terminal or from Sequel Pro, it works fine. The Python Software Foundation Meetup Pro Network grew to include 82 groups in 19 countries with over 129,000 members In 2020, P圜on US 2021 planning. This does not seem to make any difference (I'm not even sure if mysql recognises these settings). In order to take connect-timeout, and max_allowed_packet, etc into account, I have this my.cnf-file: File: /Applications/MAMP/conf/my.cnf For some ad-hoc problem solving I have moved the limit and broken down the data I wanted into smaller batches, but this keeps popping up as a problem. But I do want to work with larger result sets. If I limit the query to result fewer result SELECT id FROM nrk2013b_tbl WHERE main_news_category = 'Sport' LIMIT 10 all is well. : 2013: Lost connection to MySQL server during query Rows = self._protocol.read_text_result(self._socket, count)įile "/Library/Python/2.7/site-packages/mysql/connector/protocol.py", line 309, in read_text_resultįile "/Library/Python/2.7/site-packages/mysql/connector/network.py", line 226, in recv_plain (rows, eof) = self._connection.get_rows()įile "/Library/Python/2.7/site-packages/mysql/connector/connection.py", line 669, in get_rows This results in the error I get most of the time: Traceback (most recent call last):įile "train_trainer_test.py", line 20, in įile "/Library/Python/2.7/site-packages/mysql/connector/cursor.py", line 823, in fetchall Sql = """SELECT id FROM nrk2013b_tbl WHERE main_news_category = 'Sport'""" As for why this fixes the issue, I wish I could give you a great story about deep-diving into the technical aspects of how character encoding works, but alas, I can’t. Note, I always dump the existing tables before import. The Fix When importing your database dump, you need to select Western (Mac OS Roman) as the encoding format for the file to import without issue. When I export from Sequel Pro, the database dump comes out at about 1.6MB and imports within 30 seconds. Unix_socket="/Applications/MAMP/tmp/mysql/mysql.sock", I notice today that when I export a database from one of our sites using the control panel 'Backup Database' function, it comes out at about 3.6MB and takes about 5 minutes to import. Once you’re inside the mysql console, try running your query again to see if it’s completed successfully. Here's an example that breaks: #!/usr/bin/python2.7 You can increase the number to 120 seconds to wait for two minutes: mysql -uroot -proot -connect-timeout 120 You can adjust the number 120 above to the number of seconds you’d like to wait for a connection response. Table is not corrupted, analyze table nrk2013b_tbl returns status ok. I use the "new" mysql driver from (not the "old" MySQLdb), and the mysql version that is bundled with MAMP. Unable to connect to host 127.0.0.1, or the request timed out.īe sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).When I run large queries (queries returning many rows), I get the Lost connection to MySQL server during query error, and I cannot see what I do wrong. Now i’ve installed SSL and Sequel pro not login anymore, the error is: | GRANT APPLICATION_PASSWORD_ADMIN,AUDIT_ADMIN,BACKUP_ADMIN,BINLOG_ADMIN,BINLOG_ENCRYPTION_ADMIN,CLONE_ADMIN,CONNECTION_ADMIN,ENCRYPTION_KEY_ADMIN,GROUP_REPLICATION_ADMIN,INNODB_REDO_LOG_ARCHIVE,INNODB_REDO_LOG_ENABLE,PERSIST_RO_VARIABLES_ADMIN,REPLICATION_APPLIER,REPLICATION_SLAVE_ADMIN,RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER,ROLE_ADMIN,SERVICE_CONNECTION_ADMIN,SESSION_VARIABLES_ADMIN,SET_USER_ID,SHOW_ROUTINE,SYSTEM_USER,SYSTEM_VARIABLES_ADMIN,TABLE_ENCRYPTION_ADMIN,XA_RECOVER_ADMIN ON. | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |