Description:
The instructions (or lack there of) for getting unit tests running fail on Ubuntu 20.04
https://github.com/mysql/mysql-connector-python/blob/master/CONTRIBUTING.rst
How to repeat:
- Fresh Ubuntu 20.04
- sudo apt-get install mysql-server
- git clone https://github.com/mysql/mysql-connector-python.git
- cd mysql-connector-python
- python3 unittest.py
fails with
2021-04-10 20:53:41,134 [myconnpy_tests:ERROR] Failed initializing MySQL server 'server1': MySQL binaries not found under /usr/local/mysql
You can't use --with-mysql because mysql and mysqld are not located in the same directory.
/usr/bin/mysql
/usr/sbin/mysqld
Creating a symlink to mysqld gets you bit further
- sudo ln -s /usr/sbin/mysqld /usr/bin/mysqld
- python3 unittests.py --debug --with-mysql=/usr/bin
Returns: 2021-04-10 21:04:16,282 [myconnpy_tests:ERROR] Failed initializing MySQL server 'server1': errmsg.sys and mysql_system_tables.sql not found under /usr/bin/share
- python3 unittest.py --debug --with-mysql=/usr/bin --with-mysql-share=/usr/share
Returns
2021-04-10 21:06:09,098 [myconnpy_tests:INFO] MySQL Connector/Python unittest using Python v3.8.5
2021-04-10 21:06:09,098 [myconnpy_tests:INFO] Locating mysql binaries (could take a while)
2021-04-10 21:06:09,099 [myconnpy_tests:DEBUG] Located mysqld in /usr/bin/
2021-04-10 21:06:09,099 [myconnpy_tests:DEBUG] Located mysql in /usr/bin/
2021-04-10 21:06:09,099 [myconnpy_tests:DEBUG] Using share folder: /usr/share
2021-04-10 21:06:09,160 [myconnpy_tests:DEBUG] MySQL version: (8, 0, 23) license: 0ubuntu0.20.04.1
2021-04-10 21:06:09,160 [myconnpy_tests:DEBUG] Location of MySQL Server binaries: /usr/bin/
2021-04-10 21:06:09,160 [myconnpy_tests:DEBUG] Error messages: /usr/share/mysql
2021-04-10 21:06:09,160 [myconnpy_tests:DEBUG] SQL Script folder: /usr/share/mysql
2021-04-10 21:06:09,170 [myconnpy_tests:DEBUG] MySQL version: (8, 0, 23) license: 0ubuntu0.20.04.1
2021-04-10 21:06:09,170 [myconnpy_tests:DEBUG] Failed reading pid file: [Errno 2] No such file or directory: '/home/daniel/mysql-connector-python/cpy_server1/mysql_cpy_server1.pid'
2021-04-10 21:06:09,170 [myconnpy_tests:WARNING] Can not connect to previously bootstrapped MySQL Server 'server1'; forcing bootstrapping
2021-04-10 21:06:09,171 [myconnpy_tests:INFO] Bootstrapping MySQL server 'server1'
2021-04-10 21:06:09,171 [myconnpy_tests:DEBUG] Creating directory /home/daniel/mysql-connector-python/cpy_server1
2021-04-10 21:06:09,171 [myconnpy_tests:DEBUG] Creating directory /home/daniel/mysql-connector-python/cpy_server1/tmp
2021-04-10 21:06:09,182 [myconnpy_tests:ERROR] Failed bootstrapping MySQL server 'server1': Error bootstrapping MySQL 'server1': [MY-013236] [Server] The designated data directory /home/daniel/mysql-connector-python/cpy_server1/data/ is unusable. You can remove all files that the server added to it.
Suggested fix:
Improve documentation or fix unit test build