Skip to content

Troubleshooting

Alana Darcher edited this page Jul 8, 2024 · 21 revisions

Docker issues

sudo docker-compose up -d not working

This line attempts to configure a datajoint database using an existing docker-image. To diagnose the issue, try the following steps:

  • sudo docker-compose ps if nothing is returned, then the issue is likely with docker-compose. Make sure the install is correct and that the config files are in the expected places.

Otherwise, check here.



MYSQL issues

mysql -h 127.0.0.1 -u root -P 3306 not working

Depending on the error, a couple things could be wrong. Most commonly, the issue is that mysql is not running in the background and thus can't be logged into.


if error is mysql not found:

  • most likely, this is an issue with the path.
  1. try: export PATH=${PATH}:/usr/local/mysql/bin
  2. re-run the original line. if the error is gone, add the above line to your ./bash-profile.
  • if the path is not the issue, make sure that MySQL is properly installed.

if error is ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111):

Note: if on Linux, proceed. if on macOS, exact commands may differ.

Fix: https://www.tecmint.com/fix-error-2003-hy000-cant-connect-to-mysql-server-on-127-0-0-1-111/

Summary:

  • If ps -Af | grep mysqld only returns an entry with the user name and not with mysql, similar to:

    al 18214 18159 0 13:01 pts/4 00:00:00 grep mysqld

    then mysql is not running and needs to be started.

    for Linux, try running: sudo systemctl start mysql.service and/or sudo service mysqld start

    • If either of these return: Failed to start mysqld.service: Unit mysqld.service not found., refer here.

    for macOS with Homebrew, try running: brew services start mysql@5.7

  • Check again by running ps -Af | grep mysqld Output should now look something like:

    mysql 18365 1 30 13:04 ? 00:00:01 /usr/libexec/mysqld --basedir=/usr

    al 18410 18159 0 13:04 pts/4 00:00:00 grep mysqld

  • Get the port information for where mysql is running by: sudo netstat -lnp | grep mysql (default is 3306)

  • Try logging into mysql again using that port: mysql -h 127.0.0.1 -u root -P <port> (replacing with the number given in the previous step)

If should now be possible to run the MySQL server from Terminal and within a Jupyter notebook.


if error is ERROR 1045 (28000): Access denied for user 'user'@'172.18.0.1' (using password: NO):

This can occur from running mysql -h 127.0.0.1 -u root -P 3306 or mysql -h 127.0.0.1 -u root, or from logging into the database from Jupyter without it being completely configured.

Fix:

  1. In a new terminal, try running the mysql command with an additional argument forcing the password prompt: mysql -h 127.0.0.1 -u root -p
  2. The terminal should request a password entry: Enter password: If you have not yet reconfigured your password nor have altered the docker-compose.yaml file, the password will be simple Note: it is important to change this password once you are running a stable database. For information on how to do so within the DataJoint framework, go here.
  3. If everything worked, then you will enter the MySQL monitor and now have access to the MySQL server.

if error is ERROR 1698 (28000): Access denied for user 'root'@'localhost':

Try:

  1. sudo mysql -u root
mysql> USE mysql;
mysql> CREATE USER 'YOUR_SYSTEM_USER'@'localhost' IDENTIFIED BY ''; 
mysql> GRANT ALL PRIVILEGES ON *.* TO 'YOUR_SYSTEM_USER'@'localhost';
mysql> UPDATE user SET plugin='auth_socket' WHERE User='YOUR_SYSTEM_USER';
mysql> FLUSH PRIVILEGES;
mysql> exit;
  1. service mysql restart $ service mysql restart

if output of brew postinstall mysql@5.7 includes Warning: The post-install step did not complete successfully.:

This may be caused by competing installs of MySQL.

For possible solutions, refer here.


if error is Failed to start mysqld.service: Unit mysqld.service not found.:

Likely, a new update for MySQL has been released, or some part of your original MySQL build was incomplete/incorrect.

For Ubuntu, try:

  1. sudo apt-get update, followed by,

  2. sudo apt-get install mysql-server

  3. Restart MySQL: sudo systemctl start mysql.service

  4. Then run ps -Af | grep mysqld. The output should resemble:

    mysql 7186 1 2 12:34 ? 00:00:00 /usr/sbin/mysqld

    al 10799 5963 0 12:35 pts/2 00:00:00 grep --color=auto mysqld


if error is "Can't connect to MySQL server on '127.0.0.1' ([SSL: SSLV3_ALERT_HANDSHAKE_FAILURE]:

As of writing (Jan 2024), DataJoint has not updated to Python versions > 3.9 (here). This may lead to the above error when trying to connect using datajoint.conn().

Try downgrading the Python version to ≥3.7, ≤3.9, or create a new virtual environment with an appropriate Python version.