arretx Posted January 21, 2022 Share Posted January 21, 2022 I first tried installing mysql from the Docker repository as explained on a few different youtube videos, but that failed every time. So, I went with the Bungy's Repository version, installed it with what I thought was a simple process, but after the container fires up, in the console and from any SQL tools, I'm denied access. In console if I type `mysql -u root -p` then enter the root password as I defined it during installation, I'm given the big "Access denied for user 'root'@'localhost' (using password: YES)" Stumped. What am I doing wrong? Quote Link to comment
Squid Posted January 21, 2022 Share Posted January 21, 2022 I'm definitely not a SQL guy (always used MariaDB for whatever has required a SQL db in the past), but I find it interesting that even on the sample installation method listed on the registry for MySQL docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag The same error results. Quote Link to comment
tjb_altf4 Posted January 21, 2022 Share Posted January 21, 2022 (edited) Working for me, one thing to note is you can only set the root password the first time, maybe some volume/appdata folder needs to be nuked? Run command used for test docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest Successful login using ENV set in template / run cmd root@fortytwo:~# docker exec -it some-mysql sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"' mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 8.0.28 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.02 sec) mysql> EXIT Bye Successful login via CLI passing password root@fortytwo:~# docker exec -it some-mysql bash root@a6a52d23fe48:/# mysql -uroot -pmy-secret-pw mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 Server version: 8.0.28 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SHOW DATABASES -> ; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.01 sec) mysql> exit Bye Successful login via CLI entering password manually root@fortytwo:~# docker exec -it some-mysql bash root@a6a52d23fe48:/# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 8.0.28 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> Edited January 21, 2022 by tjb_altf4 Quote Link to comment
arretx Posted January 21, 2022 Author Share Posted January 21, 2022 Well, I managed to get it installed and was able to login as root, but then, even after granting full permissions to a new user from any host, the port 3306 is not open on the system and I can't figure out how to open it up so I can connect from my remote laptop. Quote Link to comment
Squid Posted January 21, 2022 Share Posted January 21, 2022 5 hours ago, arretx said: remote You need to forward the port on the router. Although I'd personally be hesitant forwarding 3306 to 3306 as that port is probably going to be subject to a lot of automated hack attempts. Quote Link to comment
arretx Posted January 21, 2022 Author Share Posted January 21, 2022 Not remote as in WAN. Remote as in not localhost. Quote Link to comment
Squid Posted January 21, 2022 Share Posted January 21, 2022 Shouldn't be an issue so long as you reference the server's IP (host or bridge network mode) - 192.x and not the container's internal IP (172.x) Quote Link to comment
Lou Posted December 29, 2023 Share Posted December 29, 2023 Hi when I go to log into the MySQL root it hangs at enter password, the keyboard keys wont enter anything just sits blank. I tried with MariaDB and MariaDB official. Are either ok to use or is one preferred for Nextcloud? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.