ISPConfig set up with auto-installer I created a db user for a website and a db login to website ssh [email protected] (via key) mysql -u dbuser -pdbuserpassword dbname and get ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) dbexists verifyed with mysql -u root login otherwise my nextcloud installation works fine Regards Rainer
in all the mysql and maridb .cnf files port 3306 commented out and socket is enabled. I do not wont to break something again, so I would not change and if I do not know where thats in lot of cnf file in the /etc/etc/mysql structure
when trying to connect, is the user trying to connect to localhost (name) or 127.0.0.1 (ip) it may just be that the unix socket is not included in the jailkit, (which is why root can still connect ok), you may just need to use the ip to connect to the tcp port instead.
I tried: mysql -udb_user ... msql -u 'shelluser'@'127.0.0.1' .... recomotation found on the net msql -h127.0.0.1 -db_user ... got Access denied for user 'db_user'@'localhost' (using password: YES) My nextcloud installation runs fine, has only a database but no shell user, so no chroot. Again I used the auto-install to set up ISPConfig Reagards Rainer
To connect to a MySQL database from within a jail, you must connect to the localhost IP address, as the socket can not be reached as it's outside of the jail. But as you have used jails for years, you should be aware that you can not reach files and sockets that are not within a jail (which is basically the purpose of using a jail). mysql -h 127.0.0.1 -u username -pSomePassword databasename
sorry I mostly worked as root and not as the shell user. I needed the database for my typo3 installation once it is installed, as root, I never needed the shell user again But thank you Rainer
As I wrote above i tried this and sorry it still does not work: <code> zexxeb@mxxe:~$ mysql -h 127.0.0.1 -u c1xxxx -p$xxxxxxx! c1xxxxsde ERROR 1045 (28000): Access denied for user 'c1txxxx'@'localhost' (using password: YES) zexxeb@mxxe:~$ </code>
Then you are using either wrong username or password, or your password contains chars that get interpreted by bash, which means you must it either put into single quotes or use: mysql -h 127.0.0.1 -u c1xxxx -p c1xxxxsde which will make mysql command to ask you for the password interactively on the shell. You can also test this username and password using pghpmyadmin.